Exemplo n.º 1
0
 /**
  * @covers ::each()
  */
 public function test_each()
 {
     $Test1 = function ($v) {
         return is_int($v);
     };
     $Test2 = array('foo' => true, 'bar' => true, 'test' => false, 'element' => false);
     $this->Container['foo'] = 1;
     $this->Container['bar'] = 1;
     $this->Container['test'] = 'test';
     $this->Container['element'] = new \DOMElement('span', 'test');
     $this->Container->each($Test1, $Results);
     $this->assertEquals($Test2, $Results, 'IContainer::each() should return array(true, true, false, false)');
     # Invalid arguments
     try {
         $this->Container->each(null);
         $this->fail('Failed to generate exception with invalid arguments');
     } catch (InvalidArgumentException $e) {
     }
 }