コード例 #1
0
 /**
  * @depends testExchangeArrayMapping
  * @param SampleEntity $entity
  */
 public function testExport($entity)
 {
     $data = $entity->export();
     foreach ($data as $key => $value) {
         $this->assertEquals($this->_exported_data[$key], $value);
     }
 }
コード例 #2
0
ファイル: RepositoryTest.php プロジェクト: devsdmf/datamonkey
 /**
  * @depends testInitializeRepositoryWithAutoStrategy
  * @depends testInsertFirstEntityWithAutoStrategy
  * @param SampleRepository $repository
  * @param SampleEntity $entity
  */
 public function testFetchOneByCriteriaArray($repository, $entity)
 {
     $export = $entity->export();
     $primary_keys = $entity->getPrimaryKeys();
     $primary_key = $primary_keys[0]['key'];
     $value = $export[$primary_key];
     $criteria = array($primary_key => $value);
     $entity = $repository->fetchOneBy($criteria);
     $this->assertInstanceOf('\\DataMonkey\\Tests\\Mocks\\SampleEntity', $entity);
 }