Author: Nicola Pietroluongo (nik.longstone@gmail.com)
Inheritance: extends Handler
コード例 #1
0
 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')));
 }
コード例 #2
0
 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));
 }