Exemplo n.º 1
0
 /**
  * @covers RecordsMan\Condition::test
  */
 public function testTest()
 {
     $this->assertTrue($this->condition->test(['id' => 9, 'name' => 'ivan', 'range' => 15]));
     $this->assertTrue($this->condition->test(['id' => 9, 'name' => 'john', 'range' => 9]));
     $this->assertTrue($this->condition->test(['id' => 10, 'name' => 'ivan', 'range' => 25]));
     $this->assertFalse($this->condition->test(['id' => 9, 'name' => 'ivan', 'range' => 25]));
 }
Exemplo n.º 2
0
 /**
  * @covers RecordsMan\Record::_select
  */
 public function test_select()
 {
     $condition = Condition::create(['id>0', 'title ~ item%'], 'id');
     $rows = Item::_select($condition);
     $this->assertInternalType('array', $rows);
     $this->assertEquals(7, count($rows));
     $this->assertEquals(1, $rows[0]['id']);
 }