assertThat($data, new HasInDatabase($this->getConnection($connection), $table)); } private function assertDatabaseMissing(string $table, array $data, ?string $connection = null): void { $this->assertThat($data, new LogicalNot(new HasInDatabase($this->getConnection($connection), $table))); } private function getConnection(?string $name): ConnectionInterface { return ApplicationContext::getContainer()->get(ConnectionResolverInterface::class)->connection($name); } }