|
@@ 503-511 (lines=9) @@
|
| 500 |
|
$page[0] = 'foo'; |
| 501 |
|
} |
| 502 |
|
|
| 503 |
|
public function testToArray() |
| 504 |
|
{ |
| 505 |
|
$beans = $this->tdbmService->findObjects('contact', 'contact.id = :id', ['id' => 1], null, [], null, TDBMObject::class); |
| 506 |
|
|
| 507 |
|
$beanArray = $beans->toArray(); |
| 508 |
|
|
| 509 |
|
$this->assertCount(1, $beanArray); |
| 510 |
|
$this->assertEquals(1, $beanArray[0]->getProperty('id', 'contact')); |
| 511 |
|
} |
| 512 |
|
|
| 513 |
|
public function testCursorMode() |
| 514 |
|
{ |
|
@@ 622-629 (lines=8) @@
|
| 619 |
|
$bean = $this->tdbmService->findObject('contact'); |
| 620 |
|
} |
| 621 |
|
|
| 622 |
|
public function testFindObjectsByBean() |
| 623 |
|
{ |
| 624 |
|
$countryBean = $this->tdbmService->findObject('country', 'id = :id', ['id' => 1], [], TDBMObject::class); |
| 625 |
|
|
| 626 |
|
$users = $this->tdbmService->findObjects('users', $countryBean, [], null, [], null, TDBMObject::class); |
| 627 |
|
$this->assertCount(1, $users); |
| 628 |
|
$this->assertEquals('jean.dupont', $users[0]->getProperty('login', 'users')); |
| 629 |
|
} |
| 630 |
|
|
| 631 |
|
/** |
| 632 |
|
* @expectedException \TheCodingMachine\TDBM\TDBMException |