Пример #1
0
 /**
  * @return void
  */
 public function testToArrayAndFromArray()
 {
     $transfer = new TestTransfer();
     $transfer->setFoo('foo');
     $response = $this->createFullResponse($transfer);
     $array = $response->toArray();
     $this->assertTrue(is_array($array), 'toArray does not return array');
     $newResponse = new Response($array);
     $this->assertEquals($response, $newResponse);
     $this->assertNotSame($response, $newResponse);
 }
Пример #2
0
 /**
  * @return void
  */
 public function testToArrayAndFromArray()
 {
     $transfer = new TestTransfer();
     $transfer->setFoo('foo');
     $metaTransfer1 = new TestTransfer();
     $metaTransfer1->setFoo('bar');
     $metaTransfer2 = new TestTransfer();
     $metaTransfer2->setFoo('baz');
     $request = $this->createFullRequest($transfer, $metaTransfer1, $metaTransfer2);
     $array = $request->toArray();
     $this->assertTrue(is_array($array), 'toArray does not return array');
     $newRequest = new Request($array);
     $this->assertEquals($request, $newRequest);
     $this->assertNotSame($request, $newRequest);
 }