/** * Tests validation failure in the middle of a string. */ public function testInvalidWalk() { $current = array(42, 0, 'nulák'); $input = new Fluent(); $input->check($current, 'data')->walk(false)->validate('isInt'); $this->assertFalse($input->isValid()); try { $input->validateAll(); $this->fail('Expected exception \\Jyxo\\Input\\Validator\\Exception.'); } catch (\PHPUnit_Framework_AssertionFailedError $e) { throw $e; } catch (\Exception $e) { // Correctly thrown exception $this->assertInstanceOf('\\Jyxo\\Input\\Validator\\Exception', $e); } }