/** * @covers ::walk() */ public function test_walk() { $Test1 = function ($v) { return is_int($v); }; $Test2 = array('foo' => true, 'bar' => true, 'test' => false, 'element' => false, 'child' => array('foo' => true, 'self' => false), 'self' => false); $this->Container['foo'] = 1; $this->Container['bar'] = 1; $this->Container['test'] = 'test'; $this->Container['element'] = new \DOMElement('span', 'test'); $this->Container['child'] = $this->getMockForAbstractClass('\\BLW\\Type\\AContainer', array('integer')); $this->Container['child']['foo'] = 1; $this->Container->walk($Test1, $Results); $this->assertEquals($Test2, $Results, 'IContainer::each() should return array(true, true, false, false, array(true, false), false'); # Invalid arguments try { $this->Container->walk(null); $this->fail('Failed to generate exception with invalid arguments'); } catch (InvalidArgumentException $e) { } }