Esempio n. 1
0
 public function testCreateQueryByFilter()
 {
     $this->filterTestable->setIds([1, 2, 3]);
     $result = $this->testable->createQueryByFilter($this->filterTestable);
     $expectedSql = 'SELECT [Kachit\\Phalcon\\Testable\\ORM\\Entity\\EntityTestable].* FROM [Kachit\\Phalcon\\Testable\\ORM\\Entity\\EntityTestable] WHERE id IN (:phi0:, :phi1:, :phi2:)';
     $this->assertTrue(is_object($result));
     $this->assertInstanceOf('Phalcon\\Mvc\\Model\\Query\\Builder', $result);
     $this->assertEquals($expectedSql, $result->getPhql());
 }
Esempio n. 2
0
 public function testIsValidFailGetErrorMessages()
 {
     $this->testable->setLimit('foo')->setOffset(null)->isValid();
     $result = $this->testable->getValidation()->getMessages();
     $this->assertTrue(is_array($result));
 }