Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AvailabilityCheckerTest.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 
16 class AvailabilityCheckerTest extends \PHPUnit\Framework\TestCase
17 {
23  private $availabilityChecker;
24 
28  private $configMock;
29 
35  protected function setUp()
36  {
37  $this->configMock = $this->createMock(Config::class);
38  $this->availabilityChecker = new AvailabilityChecker($this->configMock);
39  }
40 
51  public function testIsAvailable(bool $isVerify3DSecure, bool $expected)
52  {
53  $this->configMock->expects($this->once())->method('isVerify3DSecure')->willReturn($isVerify3DSecure);
54  $actual = $this->availabilityChecker->isAvailable();
55  self::assertEquals($expected, $actual);
56  }
57 
63  public function isAvailableDataProvider()
64  {
65  return [
66  [true, false],
67  [false, true],
68  ];
69  }
70 }