Example #1
0
 public function testUnitOfWork()
 {
     $connection = $this->getMockBuilder(Connection::class)->disableOriginalConstructor()->getMock();
     $connection->expects($this->any())->method('getDatabasePlatform')->willReturn(new MySqlPlatform());
     $corma = ObjectMapper::withDefaults($connection, ['Corma\\Test\\Fixtures']);
     $unitOfWork = $corma->unitOfWork();
     $this->assertInstanceOf(UnitOfWork::class, $unitOfWork);
 }
Example #2
0
 public function setUp()
 {
     $this->dispatcher = new EventDispatcher();
     $this->objectMapper = ObjectMapper::withDefaults(self::$connection, ['Corma\\Test\\Fixtures']);
     $this->repository = $this->objectMapper->getRepository(ExtendedDataObject::class);
 }