public function testItTranslatesTheProductRepositorySearchResultsIntoStatusArray() { $this->mockSearchResult->method('getItems')->willReturn([$this->createMockEnabledProduct('test1'), $this->createMockDisabledProduct('test2')]); $expected = ['test1' => 'enabled', 'test2' => 'disabled']; $this->assertSame($expected, $this->productStatusAdapter->getProductStatusMatchingSku('test')); }
public function testItTranslatesProductRepositorySearchResultsIntoTheDesiredReturnArrayFormat() { $this->mockSearchResults->method('getItems')->willReturn([$this->getMockEnabledProduct('test1'), $this->getMockDisabledProduct('test2')]); $expectedResult = ['test1' => ProductStatusAdapterInterface::ENABLED, 'test2' => ProductStatusAdapterInterface::DISABLED]; $this->assertSame($expectedResult, $this->productStatusAdapter->getStatusForProductsMatchingSku('test')); }