Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PartnersTest.php
Go to the documentation of this file.
1 <?php
8 
9 class PartnersTest extends \PHPUnit\Framework\TestCase
10 {
14  private $partnersBlockMock;
15 
16  protected function setUp()
17  {
18  $this->partnersBlockMock = $this->getPartnersBlockMock(
19  [
20  'getPartnersModel'
21  ]
22  );
23  }
24 
28  public function testGetPartners()
29  {
30  $partnersModelMock = $this->getPartnersModelMock(['getPartners']);
31  $partnersModelMock->expects($this->once())
32  ->method('getPartners')
33  ->will($this->returnValue([]));
34 
35  $this->partnersBlockMock->expects($this->once())
36  ->method('getPartnersModel')
37  ->will($this->returnValue($partnersModelMock));
38 
39  $this->partnersBlockMock->getPartners();
40  }
41 
47  public function getPartnersBlockMock($methods = null)
48  {
49  return $this->createPartialMock(\Magento\Marketplace\Block\Partners::class, $methods);
50  }
51 
57  public function getPartnersModelMock($methods)
58  {
59  return $this->createPartialMock(\Magento\Marketplace\Model\Partners::class, $methods);
60  }
61 }
$methods
Definition: billing.phtml:71