コード例 #1
0
ファイル: UpdateTest.php プロジェクト: hitmeister/api-sdk-php
 public function testInstance()
 {
     /** @var \Mockery\Mock|\Hitmeister\Component\Api\Transfers\ProductDataTransfer $transfer */
     $transfer = \Mockery::mock('\\Hitmeister\\Component\\Api\\Transfers\\ProductDataTransfer');
     $transfer->shouldReceive('toArray')->once()->andReturn(['condition' => 'new']);
     $update = new Update($this->transport);
     $update->setId('1231231231232');
     $update->setTransfer($transfer);
     $this->assertInstanceOf('\\Hitmeister\\Component\\Api\\Transfers\\ProductDataTransfer', $update->getTransfer());
     $this->assertEquals('1231231231232', $update->getId());
     $this->assertEquals([], $update->getParamWhiteList());
     $this->assertEquals('PATCH', $update->getMethod());
     $this->assertEquals('product-data/1231231231232/', $update->getURI());
     $body = $update->getBody();
     $this->assertArrayHasKey('condition', $body);
 }