/** * Test that a schema tool can be created. */ public function testSchemaToolCreation() { $connection = $this->createMock(Connection::class); $configuration = $this->createMock(Configuration::class); $entityManager = $this->createMock(EntityManagerInterface::class); $entityManager->expects($this->once())->method('getConnection')->will($this->returnValue($connection)); $entityManager->expects($this->once())->method('getConfiguration')->will($this->returnValue($configuration)); $provider = new SchemaToolProvider($entityManager); $this->assertInstanceOf(SchemaTool::class, $provider->getSchemaTool()); }
/** * Get schema tool. * * @return SchemaTool */ public function getSchemaTool() { if (null === $this->schemaTool) { $provider = new SchemaToolProvider($this->getEntityManager()); $this->schemaTool = $provider->getSchemaTool(); } return $this->schemaTool; }