Exemplo n.º 1
0
 /**
  * @depends testInitializeRepositoryWithAutoStrategy
  * @depends testInsertFirstEntityWithAutoStrategy
  * @param SampleRepository $repository
  * @param SampleEntity $entity
  */
 public function testFetchOneByEntityInstance($repository, $entity)
 {
     $entity = SampleEntity::fromArray(array('id' => $entity->id));
     $entity = $repository->fetchOneBy($entity);
     $this->assertInstanceOf('\\DataMonkey\\Tests\\Mocks\\SampleEntity', $entity);
 }
Exemplo n.º 2
0
 public function testFactory()
 {
     $entity = SampleEntity::factory($this->_exported_data);
     $this->assertInstanceOf('\\DataMonkey\\Tests\\Mocks\\SampleEntity', $entity);
     $data = $entity->export();
     foreach ($data as $key => $value) {
         $this->assertEquals($this->_exported_data[$key], $value);
     }
 }
Exemplo n.º 3
0
 public function create($options = null)
 {
     return SampleEntity::factory($options);
 }