20 private $resourceConnection;
30 $this->select = $this->getMockBuilder(Select::class)
31 ->disableOriginalConstructor()
33 $this->resourceConnection = $this->getMockBuilder(ResourceConnection::class)
34 ->disableOriginalConstructor()
36 $this->connection = $this->createMock(AdapterInterface::class);
45 $storeTable =
'store';
46 $this->resourceConnection->expects($this->once())
47 ->method(
'getConnection')
48 ->willReturn($this->connection);
49 $this->resourceConnection->expects($this->once())
50 ->method(
'getTableName')
51 ->willReturn($storeTable);
52 $this->connection->expects($this->once())
54 ->willReturn($this->select);
56 $this->select->expects($this->once())
58 ->with($storeTable, [
'store_id'])
59 ->willReturn($this->select);
60 $this->select->expects($this->once())
63 ->willReturn($this->select);
64 $this->connection->expects($this->once())
68 $this->assertEquals(
$data, $this->model->getStoreByWebsiteId(
$websiteId));
testGetStoreByWebsiteId()