コード例 #1
0
ファイル: ResponseTest.php プロジェクト: spryker/ZedRequest
 /**
  * @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
ファイル: RequestTest.php プロジェクト: spryker/ZedRequest
 /**
  * @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);
 }