Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CookieLifetimeValidatorTest.php
Go to the documentation of this file.
1 <?php
9 
10 class CookieLifetimeValidatorTest extends \PHPUnit\Framework\TestCase
11 {
13  private $model;
14 
15  public function setUp()
16  {
18  $this->model = $objectManager->create(
19  \Magento\Framework\Session\Config\Validator\CookieLifetimeValidator::class
20  );
21  }
22 
23  public function testNonNumeric()
24  {
25  $this->assertFalse($this->model->isValid('non-numeric value'));
26  }
27 
28  public function testNegative()
29  {
30  $this->assertFalse($this->model->isValid(-1));
31  }
32 
33  public function testPositive()
34  {
35  $this->assertTrue($this->model->isValid(1));
36  }
37 
38  public function testZero()
39  {
40  $this->assertTrue($this->model->isValid(0));
41  }
42 }
$objectManager
Definition: bootstrap.php:17