addDefinitions([ DatabaseConnection::class => autowire()->constructorParameter(parameter: 'config', value: $config), ]); $this->container = $containerBuilder->build(); $this->nameserverRepository = $this->container->get(name: NameserverRepository::class); } /** * @throws \DI\NotFoundException * @throws \DI\DependencyException */ public function testInsert() { $nameserver = new Nameserver(name: 'inserttest.org', a: '1.2.3.4', aaaa: '1bad::babe'); $this->nameserverRepository->insert(nameserver: $nameserver); $nameservertest = $this->nameserverRepository->findByName(name: 'inserttest.org'); $this->assertIsNotBool(actual: $nameserver); $this->assertEquals(expected: 'inserttest.org', actual: $nameservertest->getName()); // clean up $this->nameserverRepository->delete(id: $nameservertest->getId()); } }