Skip to content

Commit

Permalink
Correcting code to conform with static code testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Robie committed Oct 10, 2017
1 parent 3381ec0 commit 0f1b58f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ protected function mockContext()
->willReturn($this->registry);
}

public function testGetGalleryImagesJsonWithLabel(){
public function testGetGalleryImagesJsonWithLabel()
{
$this->prepareGetGalleryImagesJsonMocks();
$json = $this->model->getGalleryImagesJson();
$decodedJson = json_decode($json, true);
Expand All @@ -91,15 +92,17 @@ public function testGetGalleryImagesJsonWithLabel(){
$this->assertEquals('test_video_url', $decodedJson[0]['videoUrl']);
}

public function testGetGalleryImagesJsonWithoutLabel(){
public function testGetGalleryImagesJsonWithoutLabel()
{
$this->prepareGetGalleryImagesJsonMocks(false);
$json = $this->model->getGalleryImagesJson();
$decodedJson = json_decode($json, true);
$this->assertEquals('test_product_name', $decodedJson[0]['caption']);

}

private function prepareGetGalleryImagesJsonMocks($hasLabel = true){
private function prepareGetGalleryImagesJsonMocks($hasLabel = true)
{
$storeMock = $this->getMockBuilder(\Magento\Store\Model\Store::class)
->disableOriginalConstructor()
->getMock();
Expand Down

0 comments on commit 0f1b58f

Please sign in to comment.