Ejemplo n.º 1
0
 /**
  * Creates a new responder request.
  *
  * Although you can create a Request instance manually it is highly
  * recommended to use this factory method, because only this one
  * ensures, that the request uses a previously unused request id.
  *
  * @param RequestParametersInterface|null $parameters
  * @param ReaderInterface|null            $stdin
  *
  * @return RequestInterface
  */
 public function newRequest(RequestParametersInterface $parameters = null, ReaderInterface $stdin = null)
 {
     return new Request(Role::responder(), $this->nextRequestId++, true, $parameters, $stdin);
 }
Ejemplo n.º 2
0
 /**
  * @covers ::getStdin
  */
 public function testInstanceKeepsStdin()
 {
     $request = new Request(Role::responder(), 5, false, new RequestParameters(['foo' => 'bar']), new StringReader('baz'));
     self::assertEquals('baz', $request->getStdin()->read(3));
 }
Ejemplo n.º 3
0
 /**
  * @covers ::responder
  */
 public function testDirectInstanciationMethodOfResponder()
 {
     $expectedRole = Role::instance(Role::RESPONDER);
     $role = Role::responder();
     self::assertSame($expectedRole, $role);
 }