Code Duplication    Length = 17-17 lines in 2 locations

tests/ClientTest.php 1 location

@@ 176-192 (lines=17) @@
173
     * @expectedException Radowoj\Yaah\Exception
174
     * @expectedExceptionMessage Invalid WebAPI doQuerySysStatus() response
175
     */
176
    public function testExceptionOnInvalidQuerySysStatusResponse()
177
    {
178
        $config = $this->getConfig();
179
180
        $soapClient = $this->getMockBuilder(SoapClient::class)
181
            ->disableOriginalConstructor()
182
            ->setMethods(['doQuerySysStatus', 'doSomethingAfterLogin'])
183
            ->getMock();
184
185
        //Allegro version key should be requested for first login per request
186
        $soapClient->expects($this->once())
187
            ->method('doQuerySysStatus')
188
            ->willReturn((object)['trololo' => 'thisIsNotAVersionKey']);
189
190
        $client = new Client($config, $soapClient);
191
        $client->login();
192
    }
193
194
195
    /**

tests/HelperTest.php 1 location

@@ 429-445 (lines=17) @@
426
     * @expectedException Radowoj\Yaah\Exception
427
     * @expectedExceptionMessage Invalid WebAPI response: stdClass Object
428
     */
429
    public function testGetAuctionByItemIdExceptionOnInvalidResponse()
430
    {
431
        $apiClient = $this->getMockBuilder(Client::class)
432
            ->disableOriginalConstructor()
433
            ->setMethods(['doGetItemFields'])
434
            ->getMock();
435
436
        $apiClient->expects($this->once())
437
            ->method('doGetItemFields')
438
            ->with($this->equalTo([
439
                'itemId' => 4321,
440
            ]))
441
            ->willReturn((object)[]);
442
443
        $helper = new Helper($apiClient);
444
        $helper->getAuctionByItemId(4321);
445
    }
446
447
448
    public function testGetAuctionByItem()