Beispiel #1
0
 /**
  * @dataProvider data_not_instance_of
  * @covers Array_Util::not_instance_of
  */
 public function test_not_instance_of($array, $class, $expected)
 {
     $this->assertSame($expected, Array_Util::not_instance_of($array, $class));
 }
Beispiel #2
0
 public static function validate_instance_of(array $items, $class)
 {
     if (($index = Array_Util::not_instance_of($items, $class)) !== FALSE) {
         throw new Kohana_Exception('The array must be of Model_Purchase_Item object, item [:index] was ":type"', array(':type' => is_object($items[$index]) ? get_class($items[$index]) : gettype($items[$index]), ':index' => $index));
     }
 }