Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CookiePathValidatorTest.php
Go to the documentation of this file.
1 <?php
9 
10 class CookiePathValidatorTest extends \PHPUnit\Framework\TestCase
11 {
13  private $model;
14 
15  public function setUp()
16  {
18  $this->model = $objectManager->create(\Magento\Framework\Session\Config\Validator\CookiePathValidator::class);
19  }
20 
21  public function testNoLeadingSlash()
22  {
23  $path = 'path';
24  $this->assertFalse($this->model->isValid($path));
25  }
26 
27  public function testInvalidPath()
28  {
29  $path = '/path?query=query';
30  $this->assertFalse($this->model->isValid($path));
31  }
32 
33  public function testValidPath()
34  {
35  $path = '/';
36  $this->assertTrue($this->model->isValid($path));
37  }
38 }
$objectManager
Definition: bootstrap.php:17