public function testHandlerWithConfiguration() { $fakeConf = array('fakeTest' => array('Unknown', 'Surname' => null)); $firstHandler = new CustomFakerClass(); $handler = new ConfFakerClass($fakeConf); $firstHandler->setSuccessor($handler); $this->assertInstanceOf('Fakerino\\Core\\FakeHandler\\Handler', $firstHandler); $this->assertInternalType('array', $firstHandler->handle(new FakeElement('fakeTest'))); }
public function testHandlerWithOptions() { $length = 1; $handler = new CustomFakerClass(); $data = new FakeElement('Integer', array('length' => $length)); $result = $handler->handle($data); $this->assertInstanceOf('Fakerino\\Core\\FakeHandler\\Handler', $handler); $this->assertInternalType('int', $result); $this->assertEquals($length, strlen($result)); }