|
@@ 115-132 (lines=18) @@
|
| 112 |
|
}
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
public function testToApiRepresentation()
|
| 116 |
|
{
|
| 117 |
|
$expectedResult = [
|
| 118 |
|
'whatever' => 'just testing if it is forwarded correctly'
|
| 119 |
|
];
|
| 120 |
|
|
| 121 |
|
$auction = $this->getMockBuilder(Auction::class)
|
| 122 |
|
->setMethods(['toApiRepresentation'])
|
| 123 |
|
->getMock();
|
| 124 |
|
|
| 125 |
|
$auction->expects($this->once())
|
| 126 |
|
->method('toApiRepresentation')
|
| 127 |
|
->willReturn($expectedResult);
|
| 128 |
|
|
| 129 |
|
$decorator = new MTGRedAuctionDecorator($auction);
|
| 130 |
|
$result = $decorator->toApiRepresentation();
|
| 131 |
|
$this->assertSame($expectedResult, $result);
|
| 132 |
|
}
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
public function testFromApiRepresentation()
|
|
@@ 135-152 (lines=18) @@
|
| 132 |
|
}
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
public function testFromApiRepresentation()
|
| 136 |
|
{
|
| 137 |
|
$expectedArgument = [
|
| 138 |
|
'whatever' => 'just testing if it is forwarded correctly'
|
| 139 |
|
];
|
| 140 |
|
|
| 141 |
|
$auction = $this->getMockBuilder(Auction::class)
|
| 142 |
|
->setMethods(['fromApiRepresentation'])
|
| 143 |
|
->getMock();
|
| 144 |
|
|
| 145 |
|
$auction->expects($this->once())
|
| 146 |
|
->method('fromApiRepresentation')
|
| 147 |
|
->with($this->equalTo($expectedArgument));
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
$decorator = new MTGRedAuctionDecorator($auction);
|
| 151 |
|
$result = $decorator->fromApiRepresentation($expectedArgument);
|
| 152 |
|
}
|
| 153 |
|
|
| 154 |
|
|
| 155 |
|
}
|