Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2695f55
commit a52b1ce
Showing
5 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Tests\Clients; | ||
|
||
use App\Stock; | ||
use App\Clients\BestBuy; | ||
use Tests\TestCase; | ||
use RetailerWithProductSeeder; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
|
||
/** | ||
* @group api | ||
*/ | ||
class BestBuyTest extends TestCase | ||
{ | ||
use RefreshDatabase; | ||
|
||
/** @test */ | ||
function it_tracks_a_product() | ||
{ | ||
$this->seed(RetailerWithProductSeeder::class); | ||
|
||
$stock = tap(Stock::first())->update([ | ||
'sku' => '6364253', // Nintendo Switch sku | ||
'url' => 'https://www.bestbuy.com/site/nintendo-switch-32gb-console-gray-joy-con/6364253.p?skuId=6364253' | ||
]); | ||
|
||
try { | ||
(new BestBuy())->checkAvailability($stock); | ||
} catch (\Exception $e) { | ||
$this->fail('Failed to track the BestBuy API properly.'); | ||
} | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |