Skip to content

Commit

Permalink
MAGETWO-52717: [GitHub] Configurable product disabling lowest price a…
Browse files Browse the repository at this point in the history
…ssociated product still shows its price #4419

-- fix unit tests
  • Loading branch information
vnayda committed Oct 6, 2016
1 parent 31edc62 commit 97c5483
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ class StockStatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase
*/
private $resource;

/**
* @var MetadataPool|\PHPUnit_Framework_MockObject_MockObject
*/
private $metadataPool;

/**
* @var Select|\PHPUnit_Framework_MockObject_MockObject
*/
Expand All @@ -40,32 +35,20 @@ class StockStatusBaseSelectProcessorTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->resource = $this->getMockBuilder(ResourceConnection::class)->disableOriginalConstructor()->getMock();
$this->metadataPool = $this->getMockBuilder(MetadataPool::class)->disableOriginalConstructor()->getMock();
$this->select = $this->getMockBuilder(Select::class)->disableOriginalConstructor()->getMock();

$this->stockStatusBaseSelectProcessor = (new ObjectManager($this))->getObject(
StockStatusBaseSelectProcessor::class,
[
'resource' => $this->resource,
'metadataPool' => $this->metadataPool,
]
);
}

public function testProcess()
{
$linkField = 'link_field';
$tableName = 'table_name';

$metadata = $this->getMock(EntityMetadataInterface::class);
$metadata->expects($this->once())
->method('getLinkField')
->willReturn($linkField);
$this->metadataPool->expects($this->once())
->method('getMetadata')
->with(ProductInterface::class)
->willReturn($metadata);

$this->resource->expects($this->once())
->method('getTableName')
->with('cataloginventory_stock_status')
Expand All @@ -75,7 +58,7 @@ public function testProcess()
->method('join')
->with(
['stock' => $tableName],
sprintf('stock.product_id = %s.%s', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS, $linkField),
sprintf('stock.product_id = %s.entity_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS),
[]
)
->willReturnSelf();
Expand Down

0 comments on commit 97c5483

Please sign in to comment.