Example #1
0
 /**
  * test other compare operators
  */
 public function testCompareOperators()
 {
     $object = new Object(['data' => ['first' => 5, 'second' => true, 'object' => new Object()]]);
     $bool = $object->compareData(false, 'second', '!=');
     $this->assertTrue($bool);
     $bool = $object->compareData(false, 'second', '<>');
     $this->assertTrue($bool);
     $bool = $object->compareData(6, 'first', '>');
     $this->assertTrue($bool);
     $bool = $object->compareData(4, 'first', '<');
     $this->assertTrue($bool);
     $bool = $object->compareData(4, 'first', '<=');
     $this->assertTrue($bool);
     $bool = $object->compareData(6, 'first', '>=');
     $this->assertTrue($bool);
     $bool = $object->compareData('', 'first', 'unknown');
     $this->assertNull($bool);
 }