Пример #1
0
 function Test_of_findLastBy()
 {
     $Users = new AkTestUser();
     $this->assertErrorPattern('/Argument list did not match expected set/', $Users->findLastBy("username", 'tim_oreilly'));
     $this->assertErrorPattern('/Argument list did not match expected set/', $Users->findLastBy("user_name AND password", 'tim_oreilly'));
     $AkTestFields = new AkTestField();
     $this->assertTrue($AkTestField = $AkTestFields->findLastBy('(varchar_field:begins OR int8_field OR timestamp_field:<) AND tinyint_field:>=', 2, 3, '2005/05/04 23:00:00', 2));
     $this->assertEqual($AkTestField->varchar_field, '4 string');
 }
Пример #2
0
 public function Test_of_findLastBy()
 {
     $Users = new AkTestUser();
     // $this->expectError(new PatternExpectation('/Argument list did not match expected set/'));
     try {
         $Users->findLastBy("username", 'tim_oreilly');
         $this->fail();
     } catch (InvalidArgumentException $e) {
         $this->pass();
     }
     // $this->expectError(new PatternExpectation('/Argument list did not match expected set/'));
     try {
         $Users->findLastBy("user_name AND password", 'tim_oreilly');
         $this->fail();
     } catch (InvalidArgumentException $e) {
         $this->pass();
     }
     $AkTestFields = new AkTestField();
     $this->assertTrue($AkTestField = $AkTestFields->findLastBy('(varchar_field:begins OR int8_field OR timestamp_field:<) AND tinyint_field:>=', 2, 3, '2005/05/04 23:00:00', 2));
     $this->assertEqual($AkTestField->varchar_field, '4 string');
 }