Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UrlRewriteTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class UrlRewriteTest extends \PHPUnit\Framework\TestCase
11 {
15  protected $_helper;
16 
17  protected function setUp()
18  {
19  $this->_helper = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this))->getObject(
20  \Magento\UrlRewrite\Helper\UrlRewrite::class
21  );
22  }
23 
27  public function testValidateRequestPath($requestPath)
28  {
29  $this->assertTrue($this->_helper->validateRequestPath($requestPath));
30  }
31 
36  public function testValidateRequestPathException($requestPath)
37  {
38  $this->_helper->validateRequestPath($requestPath);
39  }
40 
44  public function testValidateSuffix($suffix)
45  {
46  $this->assertTrue($this->_helper->validateSuffix($suffix));
47  }
48 
54  {
55  $this->_helper->validateSuffix($suffix);
56  }
57 
61  public function requestPathDataProvider()
62  {
63  return [
64  'no leading slash' => ['correct/request/path'],
65  'leading slash' => ['another/good/request/path/']
66  ];
67  }
68 
73  {
74  return [
75  'two slashes' => ['request/path/with/two//slashes'],
76  'three slashes' => ['request/path/with/three///slashes'],
77  'anchor' => ['request/path/with#anchor']
78  ];
79  }
80 }
$suffix
Definition: name.phtml:27