@@ 511-519 (lines=9) @@ | ||
508 | $page[0] = 'foo'; |
|
509 | } |
|
510 | ||
511 | public function testToArray() |
|
512 | { |
|
513 | $beans = $this->tdbmService->findObjects('contact', 'contact.id = :id', ['id' => 1], null, [], null, TDBMObject::class); |
|
514 | ||
515 | $beanArray = $beans->toArray(); |
|
516 | ||
517 | $this->assertCount(1, $beanArray); |
|
518 | $this->assertEquals(1, $beanArray[0]->getProperty('id', 'contact')); |
|
519 | } |
|
520 | ||
521 | public function testCursorMode() |
|
522 | { |
|
@@ 630-637 (lines=8) @@ | ||
627 | $bean = $this->tdbmService->findObject('contact'); |
|
628 | } |
|
629 | ||
630 | public function testFindObjectsByBean() |
|
631 | { |
|
632 | $countryBean = $this->tdbmService->findObject('country', 'id = :id', ['id' => 1], [], TDBMObject::class); |
|
633 | ||
634 | $users = $this->tdbmService->findObjects('users', $countryBean, [], null, [], null, TDBMObject::class); |
|
635 | $this->assertCount(1, $users); |
|
636 | $this->assertEquals('jean.dupont', $users[0]->getProperty('login', 'users')); |
|
637 | } |
|
638 | ||
639 | /** |
|
640 | * @expectedException \TheCodingMachine\TDBM\TDBMException |