protected function setUp() { // class has private constructor $this->type = $this->getMockBuilder('Oro\\Bundle\\LocaleBundle\\DoctrineExtensions\\DBAL\\Types\\UTCTimeType')->setMethods(null)->disableOriginalConstructor()->getMock(); $this->platform = $this->getMockBuilder('Doctrine\\DBAL\\Platforms\\AbstractPlatform')->disableOriginalConstructor()->setMethods(array('getTimeFormatString'))->getMockForAbstractClass(); $this->platform->expects($this->any())->method('getTimeFormatString')->will($this->returnValue('H:i:s')); }
protected function setUp() { $this->platform = $this->getMockBuilder('Doctrine\\DBAL\\Platforms\\AbstractPlatform')->setMethods(array('getVarcharTypeDeclarationSQL'))->getMockForAbstractClass(); $this->platform->expects($this->any())->method('getVarcharTypeDeclarationSQL')->will($this->returnValue('DUMMYVARCHAR()')); $this->type = Type::getType('phone_number'); $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); }
public function testResetsQueries() { foreach (array('supportsSchemas', 'supportsForeignKeys') as $method) { $this->platformMock->expects($this->any())->method($method)->will($this->returnValue(true)); } $table = $this->createTableMock(); $foreignKey = $this->createForeignKeyConstraintMock(); $sequence = $this->createSequenceMock(); $this->visitor->acceptNamespace('foo'); $this->visitor->acceptTable($table); $this->visitor->acceptForeignKey($table, $foreignKey); $this->visitor->acceptSequence($sequence); $this->assertNotEmpty($this->visitor->getQueries()); $this->visitor->resetQueries(); $this->assertEmpty($this->visitor->getQueries()); }
protected function setUp() { $this->platform = $this->getMockBuilder('Doctrine\\DBAL\\Platforms\\AbstractPlatform')->setMethods(array('getGuidTypeDeclarationSQL'))->getMockForAbstractClass(); $this->platform->expects($this->any())->method('getGuidTypeDeclarationSQL')->will($this->returnValue('DUMMYVARCHAR()')); $this->type = Type::getType('str_uuid'); }