Tawk.To Live Chat - Version 0.7.1

Version Description

  • Fixed compatibility issue on PHP versions >
Download this release

Release Info

Developer alvinsotawk
Plugin Icon 128x128 Tawk.To Live Chat
Version 0.7.1
Comparing to
See all releases

Code changes from version 0.7.0 to 0.7.1

readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: tawk,tawk.to,tawkto,chat,free chat,livechat,chat widget,plugin,chat for we
4
  Requires at least: 2.7
5
  Requires PHP: 5.6
6
  Tested up to: 5.9
7
- Stable tag: 0.7.0
8
 
9
  (OFFICIAL tawk.to plugin) Instantly chat with visitors on your website with the free tawk.to chat widget.
10
  Website: [http://tawk.to](http://tawk.to)
@@ -69,6 +69,9 @@ Note: You will need a free tawk.to account: [Create one for free here!](https://
69
 
70
  == Changelog ==
71
 
 
 
 
72
  = 0.7.0 =
73
  * Enhanced URL pattern matching.
74
  * Supported version bump 5.9.
4
  Requires at least: 2.7
5
  Requires PHP: 5.6
6
  Tested up to: 5.9
7
+ Stable tag: 0.7.1
8
 
9
  (OFFICIAL tawk.to plugin) Instantly chat with visitors on your website with the free tawk.to chat widget.
10
  Website: [http://tawk.to](http://tawk.to)
69
 
70
  == Changelog ==
71
 
72
+ = 0.7.1 =
73
+ * Fixed compatibility issue on PHP versions >= 5.6.
74
+
75
  = 0.7.0 =
76
  * Enhanced URL pattern matching.
77
  * Supported version bump 5.9.
tawkto.php CHANGED
@@ -6,7 +6,7 @@
6
  * Plugin Name: Tawk.to Live Chat
7
  * Plugin URI: https://www.tawk.to
8
  * Description: Embeds Tawk.to live chat widget to your site
9
- * Version: 0.7.0
10
  * Author: Tawkto
11
  * Text Domain: tawk-to-live-chat
12
  **/
6
  * Plugin Name: Tawk.to Live Chat
7
  * Plugin URI: https://www.tawk.to
8
  * Description: Embeds Tawk.to live chat widget to your site
9
+ * Version: 0.7.1
10
  * Author: Tawkto
11
  * Text Domain: tawk-to-live-chat
12
  **/
templates/widget.php CHANGED
@@ -8,7 +8,7 @@
8
 
9
  ?>
10
 
11
- <!--Start of Tawk.to Script (0.7.0)-->
12
  <script id="tawk-script" type="text/javascript">
13
  var Tawk_API = Tawk_API || {};
14
  <?php if ( isset( $customer_details ) && $enable_visitor_recognition ) : ?>
@@ -24,4 +24,4 @@ var Tawk_LoadStart=new Date();
24
  s0.parentNode.insertBefore( s1, s0 );
25
  })();
26
  </script>
27
- <!--End of Tawk.to Script (0.7.0)-->
8
 
9
  ?>
10
 
11
+ <!--Start of Tawk.to Script (0.7.1)-->
12
  <script id="tawk-script" type="text/javascript">
13
  var Tawk_API = Tawk_API || {};
14
  <?php if ( isset( $customer_details ) && $enable_visitor_recognition ) : ?>
24
  s0.parentNode.insertBefore( s1, s0 );
25
  })();
26
  </script>
27
+ <!--End of Tawk.to Script (0.7.1)-->
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit3eb597ada59a4a18b26320b23bc7d0c2::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit45ed81d470a6253db4ed8c2208f1d5c8::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit3eb597ada59a4a18b26320b23bc7d0c2
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit3eb597ada59a4a18b26320b23bc7d0c2
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit3eb597ada59a4a18b26320b23bc7d0c2', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInit3eb597ada59a4a18b26320b23bc7d0c2', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit3eb597ada59a4a18b26320b23bc7d0c2::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit45ed81d470a6253db4ed8c2208f1d5c8
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit45ed81d470a6253db4ed8c2208f1d5c8', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit45ed81d470a6253db4ed8c2208f1d5c8', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit45ed81d470a6253db4ed8c2208f1d5c8::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit3eb597ada59a4a18b26320b23bc7d0c2
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
@@ -32,9 +32,9 @@ class ComposerStaticInit3eb597ada59a4a18b26320b23bc7d0c2
32
  public static function getInitializer(ClassLoader $loader)
33
  {
34
  return \Closure::bind(function () use ($loader) {
35
- $loader->prefixLengthsPsr4 = ComposerStaticInit3eb597ada59a4a18b26320b23bc7d0c2::$prefixLengthsPsr4;
36
- $loader->prefixDirsPsr4 = ComposerStaticInit3eb597ada59a4a18b26320b23bc7d0c2::$prefixDirsPsr4;
37
- $loader->classMap = ComposerStaticInit3eb597ada59a4a18b26320b23bc7d0c2::$classMap;
38
 
39
  }, null, ClassLoader::class);
40
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit45ed81d470a6253db4ed8c2208f1d5c8
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'T' =>
32
  public static function getInitializer(ClassLoader $loader)
33
  {
34
  return \Closure::bind(function () use ($loader) {
35
+ $loader->prefixLengthsPsr4 = ComposerStaticInit45ed81d470a6253db4ed8c2208f1d5c8::$prefixLengthsPsr4;
36
+ $loader->prefixDirsPsr4 = ComposerStaticInit45ed81d470a6253db4ed8c2208f1d5c8::$prefixDirsPsr4;
37
+ $loader->classMap = ComposerStaticInit45ed81d470a6253db4ed8c2208f1d5c8::$classMap;
38
 
39
  }, null, ClassLoader::class);
40
  }
vendor/composer/installed.json CHANGED
@@ -2,23 +2,25 @@
2
  "packages": [
3
  {
4
  "name": "tawk/url-utils",
5
- "version": "2.0.0",
6
- "version_normalized": "2.0.0.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/tawk/tawk-url-utils.git",
10
- "reference": "ec70275363ff0dac9d70c9a93399161e5e561a88"
11
  },
12
  "dist": {
13
  "type": "zip",
14
- "url": "https://api.github.com/repos/tawk/tawk-url-utils/zipball/ec70275363ff0dac9d70c9a93399161e5e561a88",
15
- "reference": "ec70275363ff0dac9d70c9a93399161e5e561a88",
16
  "shasum": ""
17
  },
18
  "require-dev": {
19
- "phpunit/phpunit": "^9.5"
 
 
20
  },
21
- "time": "2021-12-29T08:42:47+00:00",
22
  "type": "library",
23
  "installation-source": "dist",
24
  "autoload": {
@@ -28,12 +30,24 @@
28
  }
29
  },
30
  "scripts": {
 
 
 
 
 
 
31
  "test": [
32
  "phpunit"
 
 
 
 
 
 
33
  ]
34
  },
35
  "support": {
36
- "source": "https://github.com/tawk/tawk-url-utils/tree/2.0.0",
37
  "issues": "https://github.com/tawk/tawk-url-utils/issues"
38
  },
39
  "install-path": "../tawk/url-utils"
2
  "packages": [
3
  {
4
  "name": "tawk/url-utils",
5
+ "version": "2.0.1",
6
+ "version_normalized": "2.0.1.0",
7
  "source": {
8
  "type": "git",
9
  "url": "https://github.com/tawk/tawk-url-utils.git",
10
+ "reference": "73c166333707d893b0160fa9b5eae7aa8fbfa03c"
11
  },
12
  "dist": {
13
  "type": "zip",
14
+ "url": "https://api.github.com/repos/tawk/tawk-url-utils/zipball/73c166333707d893b0160fa9b5eae7aa8fbfa03c",
15
+ "reference": "73c166333707d893b0160fa9b5eae7aa8fbfa03c",
16
  "shasum": ""
17
  },
18
  "require-dev": {
19
+ "phpcompatibility/php-compatibility": "^9.3",
20
+ "phpunit/phpunit": "^9.5",
21
+ "squizlabs/php_codesniffer": "^3.6"
22
  },
23
+ "time": "2022-01-28T11:14:45+00:00",
24
  "type": "library",
25
  "installation-source": "dist",
26
  "autoload": {
30
  }
31
  },
32
  "scripts": {
33
+ "post-install-cmd": [
34
+ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility)"
35
+ ],
36
+ "post-update-cmd": [
37
+ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility)"
38
+ ],
39
  "test": [
40
  "phpunit"
41
+ ],
42
+ "lint": [
43
+ "phpcs -p -s -v --runtime-set ignore_warnings_on_exit true ."
44
+ ],
45
+ "lint:fix": [
46
+ "phpcbf -p -s -v .; err=$?; if [ $err -eq 1 ]; then exit 0; else exit $err; fi;"
47
  ]
48
  },
49
  "support": {
50
+ "source": "https://github.com/tawk/tawk-url-utils/tree/2.0.1",
51
  "issues": "https://github.com/tawk/tawk-url-utils/issues"
52
  },
53
  "install-path": "../tawk/url-utils"
vendor/composer/installed.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php return array(
2
  'root' => array(
3
- 'pretty_version' => '0.7.0',
4
- 'version' => '0.7.0.0',
5
  'type' => 'project',
6
  'install_path' => __DIR__ . '/../../../',
7
  'aliases' => array(),
@@ -11,8 +11,8 @@
11
  ),
12
  'versions' => array(
13
  'tawk/tawk-wordpress' => array(
14
- 'pretty_version' => '0.7.0',
15
- 'version' => '0.7.0.0',
16
  'type' => 'project',
17
  'install_path' => __DIR__ . '/../../../',
18
  'aliases' => array(),
@@ -20,12 +20,12 @@
20
  'dev_requirement' => false,
21
  ),
22
  'tawk/url-utils' => array(
23
- 'pretty_version' => '2.0.0',
24
- 'version' => '2.0.0.0',
25
  'type' => 'library',
26
  'install_path' => __DIR__ . '/../tawk/url-utils',
27
  'aliases' => array(),
28
- 'reference' => 'ec70275363ff0dac9d70c9a93399161e5e561a88',
29
  'dev_requirement' => false,
30
  ),
31
  ),
1
  <?php return array(
2
  'root' => array(
3
+ 'pretty_version' => '0.7.1',
4
+ 'version' => '0.7.1.0',
5
  'type' => 'project',
6
  'install_path' => __DIR__ . '/../../../',
7
  'aliases' => array(),
11
  ),
12
  'versions' => array(
13
  'tawk/tawk-wordpress' => array(
14
+ 'pretty_version' => '0.7.1',
15
+ 'version' => '0.7.1.0',
16
  'type' => 'project',
17
  'install_path' => __DIR__ . '/../../../',
18
  'aliases' => array(),
20
  'dev_requirement' => false,
21
  ),
22
  'tawk/url-utils' => array(
23
+ 'pretty_version' => '2.0.1',
24
+ 'version' => '2.0.1.0',
25
  'type' => 'library',
26
  'install_path' => __DIR__ . '/../tawk/url-utils',
27
  'aliases' => array(),
28
+ 'reference' => '73c166333707d893b0160fa9b5eae7aa8fbfa03c',
29
  'dev_requirement' => false,
30
  ),
31
  ),
vendor/tawk/url-utils/.gitattributes DELETED
@@ -1 +0,0 @@
1
- /.github export-ignore
 
vendor/tawk/url-utils/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- /vendor/
2
- .phpunit.*
 
 
vendor/tawk/url-utils/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  # 2.0.0
2
 
3
  ## General changes
1
+ # 2.0.1
2
+
3
+ Fixed compatibility issue for PHP version >= 5.6.
4
+
5
  # 2.0.0
6
 
7
  ## General changes
vendor/tawk/url-utils/composer.json CHANGED
@@ -2,9 +2,11 @@
2
  "name": "tawk/url-utils",
3
  "type": "library",
4
  "require-dev": {
5
- "phpunit/phpunit": "^9.5"
 
 
6
  },
7
- "version" : "2.0.0",
8
  "autoload": {
9
  "psr-4": {
10
  "Tawk\\": "lib",
@@ -12,6 +14,14 @@
12
  }
13
  },
14
  "scripts": {
15
- "test": "phpunit"
 
 
 
 
 
 
 
 
16
  }
17
  }
2
  "name": "tawk/url-utils",
3
  "type": "library",
4
  "require-dev": {
5
+ "phpunit/phpunit": "^9.5",
6
+ "squizlabs/php_codesniffer": "^3.6",
7
+ "phpcompatibility/php-compatibility": "^9.3"
8
  },
9
+ "version" : "2.0.1",
10
  "autoload": {
11
  "psr-4": {
12
  "Tawk\\": "lib",
14
  }
15
  },
16
  "scripts": {
17
+ "post-install-cmd": [
18
+ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility)"
19
+ ],
20
+ "post-update-cmd": [
21
+ "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility)"
22
+ ],
23
+ "test": "phpunit",
24
+ "lint": "phpcs -p -s -v --runtime-set ignore_warnings_on_exit true .",
25
+ "lint:fix": "phpcbf -p -s -v .; err=$?; if [ $err -eq 1 ]; then exit 0; else exit $err; fi;"
26
  }
27
  }
vendor/tawk/url-utils/composer.lock CHANGED
@@ -4,7 +4,7 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
- "content-hash": "656998700722e65aa1bdc0601a62add9",
8
  "packages": [],
9
  "packages-dev": [
10
  {
@@ -136,16 +136,16 @@
136
  },
137
  {
138
  "name": "nikic/php-parser",
139
- "version": "v4.13.0",
140
  "source": {
141
  "type": "git",
142
  "url": "https://github.com/nikic/PHP-Parser.git",
143
- "reference": "50953a2691a922aa1769461637869a0a2faa3f53"
144
  },
145
  "dist": {
146
  "type": "zip",
147
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53",
148
- "reference": "50953a2691a922aa1769461637869a0a2faa3f53",
149
  "shasum": ""
150
  },
151
  "require": {
@@ -186,9 +186,9 @@
186
  ],
187
  "support": {
188
  "issues": "https://github.com/nikic/PHP-Parser/issues",
189
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0"
190
  },
191
- "time": "2021-09-20T12:20:58+00:00"
192
  },
193
  {
194
  "name": "phar-io/manifest",
@@ -301,6 +301,68 @@
301
  },
302
  "time": "2021-02-23T14:00:09+00:00"
303
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  {
305
  "name": "phpdocumentor/reflection-common",
306
  "version": "2.2.0",
@@ -356,16 +418,16 @@
356
  },
357
  {
358
  "name": "phpdocumentor/reflection-docblock",
359
- "version": "5.2.2",
360
  "source": {
361
  "type": "git",
362
  "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
363
- "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
364
  },
365
  "dist": {
366
  "type": "zip",
367
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
368
- "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
369
  "shasum": ""
370
  },
371
  "require": {
@@ -376,7 +438,8 @@
376
  "webmozart/assert": "^1.9.1"
377
  },
378
  "require-dev": {
379
- "mockery/mockery": "~1.3.2"
 
380
  },
381
  "type": "library",
382
  "extra": {
@@ -406,22 +469,22 @@
406
  "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
407
  "support": {
408
  "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
409
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
410
  },
411
- "time": "2020-09-03T19:13:55+00:00"
412
  },
413
  {
414
  "name": "phpdocumentor/type-resolver",
415
- "version": "1.5.1",
416
  "source": {
417
  "type": "git",
418
  "url": "https://github.com/phpDocumentor/TypeResolver.git",
419
- "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
420
  },
421
  "dist": {
422
  "type": "zip",
423
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
424
- "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
425
  "shasum": ""
426
  },
427
  "require": {
@@ -456,22 +519,22 @@
456
  "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
457
  "support": {
458
  "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
459
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
460
  },
461
- "time": "2021-10-02T14:08:47+00:00"
462
  },
463
  {
464
  "name": "phpspec/prophecy",
465
- "version": "1.14.0",
466
  "source": {
467
  "type": "git",
468
  "url": "https://github.com/phpspec/prophecy.git",
469
- "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
470
  },
471
  "dist": {
472
  "type": "zip",
473
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
474
- "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
475
  "shasum": ""
476
  },
477
  "require": {
@@ -523,29 +586,29 @@
523
  ],
524
  "support": {
525
  "issues": "https://github.com/phpspec/prophecy/issues",
526
- "source": "https://github.com/phpspec/prophecy/tree/1.14.0"
527
  },
528
- "time": "2021-09-10T09:02:12+00:00"
529
  },
530
  {
531
  "name": "phpunit/php-code-coverage",
532
- "version": "9.2.7",
533
  "source": {
534
  "type": "git",
535
  "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
536
- "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
537
  },
538
  "dist": {
539
  "type": "zip",
540
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
541
- "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
542
  "shasum": ""
543
  },
544
  "require": {
545
  "ext-dom": "*",
546
  "ext-libxml": "*",
547
  "ext-xmlwriter": "*",
548
- "nikic/php-parser": "^4.12.0",
549
  "php": ">=7.3",
550
  "phpunit/php-file-iterator": "^3.0.3",
551
  "phpunit/php-text-template": "^2.0.2",
@@ -594,7 +657,7 @@
594
  ],
595
  "support": {
596
  "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
597
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
598
  },
599
  "funding": [
600
  {
@@ -602,20 +665,20 @@
602
  "type": "github"
603
  }
604
  ],
605
- "time": "2021-09-17T05:39:03+00:00"
606
  },
607
  {
608
  "name": "phpunit/php-file-iterator",
609
- "version": "3.0.5",
610
  "source": {
611
  "type": "git",
612
  "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
613
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
614
  },
615
  "dist": {
616
  "type": "zip",
617
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
618
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
619
  "shasum": ""
620
  },
621
  "require": {
@@ -654,7 +717,7 @@
654
  ],
655
  "support": {
656
  "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
657
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
658
  },
659
  "funding": [
660
  {
@@ -662,7 +725,7 @@
662
  "type": "github"
663
  }
664
  ],
665
- "time": "2020-09-28T05:57:25+00:00"
666
  },
667
  {
668
  "name": "phpunit/php-invoker",
@@ -847,16 +910,16 @@
847
  },
848
  {
849
  "name": "phpunit/phpunit",
850
- "version": "9.5.10",
851
  "source": {
852
  "type": "git",
853
  "url": "https://github.com/sebastianbergmann/phpunit.git",
854
- "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a"
855
  },
856
  "dist": {
857
  "type": "zip",
858
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
859
- "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
860
  "shasum": ""
861
  },
862
  "require": {
@@ -934,11 +997,11 @@
934
  ],
935
  "support": {
936
  "issues": "https://github.com/sebastianbergmann/phpunit/issues",
937
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
938
  },
939
  "funding": [
940
  {
941
- "url": "https://phpunit.de/donate.html",
942
  "type": "custom"
943
  },
944
  {
@@ -946,7 +1009,7 @@
946
  "type": "github"
947
  }
948
  ],
949
- "time": "2021-09-25T07:38:51+00:00"
950
  },
951
  {
952
  "name": "sebastian/cli-parser",
@@ -1377,16 +1440,16 @@
1377
  },
1378
  {
1379
  "name": "sebastian/exporter",
1380
- "version": "4.0.3",
1381
  "source": {
1382
  "type": "git",
1383
  "url": "https://github.com/sebastianbergmann/exporter.git",
1384
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
1385
  },
1386
  "dist": {
1387
  "type": "zip",
1388
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
1389
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
1390
  "shasum": ""
1391
  },
1392
  "require": {
@@ -1435,14 +1498,14 @@
1435
  }
1436
  ],
1437
  "description": "Provides the functionality to export PHP variables for visualization",
1438
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
1439
  "keywords": [
1440
  "export",
1441
  "exporter"
1442
  ],
1443
  "support": {
1444
  "issues": "https://github.com/sebastianbergmann/exporter/issues",
1445
- "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
1446
  },
1447
  "funding": [
1448
  {
@@ -1450,7 +1513,7 @@
1450
  "type": "github"
1451
  }
1452
  ],
1453
- "time": "2020-09-28T05:24:23+00:00"
1454
  },
1455
  {
1456
  "name": "sebastian/global-state",
@@ -1912,23 +1975,82 @@
1912
  ],
1913
  "time": "2020-09-28T06:39:44+00:00"
1914
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1915
  {
1916
  "name": "symfony/polyfill-ctype",
1917
- "version": "v1.23.0",
1918
  "source": {
1919
  "type": "git",
1920
  "url": "https://github.com/symfony/polyfill-ctype.git",
1921
- "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
1922
  },
1923
  "dist": {
1924
  "type": "zip",
1925
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
1926
- "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
1927
  "shasum": ""
1928
  },
1929
  "require": {
1930
  "php": ">=7.1"
1931
  },
 
 
 
1932
  "suggest": {
1933
  "ext-ctype": "For best performance"
1934
  },
@@ -1973,7 +2095,7 @@
1973
  "portable"
1974
  ],
1975
  "support": {
1976
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
1977
  },
1978
  "funding": [
1979
  {
@@ -1989,7 +2111,7 @@
1989
  "type": "tidelift"
1990
  }
1991
  ],
1992
- "time": "2021-02-19T12:13:01+00:00"
1993
  },
1994
  {
1995
  "name": "theseer/tokenizer",
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
+ "content-hash": "0b2b26015d9256ef171c95a5a22712d1",
8
  "packages": [],
9
  "packages-dev": [
10
  {
136
  },
137
  {
138
  "name": "nikic/php-parser",
139
+ "version": "v4.13.2",
140
  "source": {
141
  "type": "git",
142
  "url": "https://github.com/nikic/PHP-Parser.git",
143
+ "reference": "210577fe3cf7badcc5814d99455df46564f3c077"
144
  },
145
  "dist": {
146
  "type": "zip",
147
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
148
+ "reference": "210577fe3cf7badcc5814d99455df46564f3c077",
149
  "shasum": ""
150
  },
151
  "require": {
186
  ],
187
  "support": {
188
  "issues": "https://github.com/nikic/PHP-Parser/issues",
189
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
190
  },
191
+ "time": "2021-11-30T19:35:32+00:00"
192
  },
193
  {
194
  "name": "phar-io/manifest",
301
  },
302
  "time": "2021-02-23T14:00:09+00:00"
303
  },
304
+ {
305
+ "name": "phpcompatibility/php-compatibility",
306
+ "version": "9.3.5",
307
+ "source": {
308
+ "type": "git",
309
+ "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
310
+ "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
311
+ },
312
+ "dist": {
313
+ "type": "zip",
314
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
315
+ "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
316
+ "shasum": ""
317
+ },
318
+ "require": {
319
+ "php": ">=5.3",
320
+ "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
321
+ },
322
+ "conflict": {
323
+ "squizlabs/php_codesniffer": "2.6.2"
324
+ },
325
+ "require-dev": {
326
+ "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
327
+ },
328
+ "suggest": {
329
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
330
+ "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
331
+ },
332
+ "type": "phpcodesniffer-standard",
333
+ "notification-url": "https://packagist.org/downloads/",
334
+ "license": [
335
+ "LGPL-3.0-or-later"
336
+ ],
337
+ "authors": [
338
+ {
339
+ "name": "Wim Godden",
340
+ "homepage": "https://github.com/wimg",
341
+ "role": "lead"
342
+ },
343
+ {
344
+ "name": "Juliette Reinders Folmer",
345
+ "homepage": "https://github.com/jrfnl",
346
+ "role": "lead"
347
+ },
348
+ {
349
+ "name": "Contributors",
350
+ "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
351
+ }
352
+ ],
353
+ "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
354
+ "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
355
+ "keywords": [
356
+ "compatibility",
357
+ "phpcs",
358
+ "standards"
359
+ ],
360
+ "support": {
361
+ "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
362
+ "source": "https://github.com/PHPCompatibility/PHPCompatibility"
363
+ },
364
+ "time": "2019-12-27T09:44:58+00:00"
365
+ },
366
  {
367
  "name": "phpdocumentor/reflection-common",
368
  "version": "2.2.0",
418
  },
419
  {
420
  "name": "phpdocumentor/reflection-docblock",
421
+ "version": "5.3.0",
422
  "source": {
423
  "type": "git",
424
  "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
425
+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
426
  },
427
  "dist": {
428
  "type": "zip",
429
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
430
+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
431
  "shasum": ""
432
  },
433
  "require": {
438
  "webmozart/assert": "^1.9.1"
439
  },
440
  "require-dev": {
441
+ "mockery/mockery": "~1.3.2",
442
+ "psalm/phar": "^4.8"
443
  },
444
  "type": "library",
445
  "extra": {
469
  "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
470
  "support": {
471
  "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
472
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
473
  },
474
+ "time": "2021-10-19T17:43:47+00:00"
475
  },
476
  {
477
  "name": "phpdocumentor/type-resolver",
478
+ "version": "1.6.0",
479
  "source": {
480
  "type": "git",
481
  "url": "https://github.com/phpDocumentor/TypeResolver.git",
482
+ "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
483
  },
484
  "dist": {
485
  "type": "zip",
486
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
487
+ "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
488
  "shasum": ""
489
  },
490
  "require": {
519
  "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
520
  "support": {
521
  "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
522
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0"
523
  },
524
+ "time": "2022-01-04T19:58:01+00:00"
525
  },
526
  {
527
  "name": "phpspec/prophecy",
528
+ "version": "v1.15.0",
529
  "source": {
530
  "type": "git",
531
  "url": "https://github.com/phpspec/prophecy.git",
532
+ "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
533
  },
534
  "dist": {
535
  "type": "zip",
536
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
537
+ "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
538
  "shasum": ""
539
  },
540
  "require": {
586
  ],
587
  "support": {
588
  "issues": "https://github.com/phpspec/prophecy/issues",
589
+ "source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
590
  },
591
+ "time": "2021-12-08T12:19:24+00:00"
592
  },
593
  {
594
  "name": "phpunit/php-code-coverage",
595
+ "version": "9.2.10",
596
  "source": {
597
  "type": "git",
598
  "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
599
+ "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687"
600
  },
601
  "dist": {
602
  "type": "zip",
603
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687",
604
+ "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687",
605
  "shasum": ""
606
  },
607
  "require": {
608
  "ext-dom": "*",
609
  "ext-libxml": "*",
610
  "ext-xmlwriter": "*",
611
+ "nikic/php-parser": "^4.13.0",
612
  "php": ">=7.3",
613
  "phpunit/php-file-iterator": "^3.0.3",
614
  "phpunit/php-text-template": "^2.0.2",
657
  ],
658
  "support": {
659
  "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
660
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10"
661
  },
662
  "funding": [
663
  {
665
  "type": "github"
666
  }
667
  ],
668
+ "time": "2021-12-05T09:12:13+00:00"
669
  },
670
  {
671
  "name": "phpunit/php-file-iterator",
672
+ "version": "3.0.6",
673
  "source": {
674
  "type": "git",
675
  "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
676
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
677
  },
678
  "dist": {
679
  "type": "zip",
680
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
681
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
682
  "shasum": ""
683
  },
684
  "require": {
717
  ],
718
  "support": {
719
  "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
720
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
721
  },
722
  "funding": [
723
  {
725
  "type": "github"
726
  }
727
  ],
728
+ "time": "2021-12-02T12:48:52+00:00"
729
  },
730
  {
731
  "name": "phpunit/php-invoker",
910
  },
911
  {
912
  "name": "phpunit/phpunit",
913
+ "version": "9.5.13",
914
  "source": {
915
  "type": "git",
916
  "url": "https://github.com/sebastianbergmann/phpunit.git",
917
+ "reference": "597cb647654ede35e43b137926dfdfef0fb11743"
918
  },
919
  "dist": {
920
  "type": "zip",
921
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743",
922
+ "reference": "597cb647654ede35e43b137926dfdfef0fb11743",
923
  "shasum": ""
924
  },
925
  "require": {
997
  ],
998
  "support": {
999
  "issues": "https://github.com/sebastianbergmann/phpunit/issues",
1000
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13"
1001
  },
1002
  "funding": [
1003
  {
1004
+ "url": "https://phpunit.de/sponsors.html",
1005
  "type": "custom"
1006
  },
1007
  {
1009
  "type": "github"
1010
  }
1011
  ],
1012
+ "time": "2022-01-24T07:33:35+00:00"
1013
  },
1014
  {
1015
  "name": "sebastian/cli-parser",
1440
  },
1441
  {
1442
  "name": "sebastian/exporter",
1443
+ "version": "4.0.4",
1444
  "source": {
1445
  "type": "git",
1446
  "url": "https://github.com/sebastianbergmann/exporter.git",
1447
+ "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9"
1448
  },
1449
  "dist": {
1450
  "type": "zip",
1451
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9",
1452
+ "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9",
1453
  "shasum": ""
1454
  },
1455
  "require": {
1498
  }
1499
  ],
1500
  "description": "Provides the functionality to export PHP variables for visualization",
1501
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
1502
  "keywords": [
1503
  "export",
1504
  "exporter"
1505
  ],
1506
  "support": {
1507
  "issues": "https://github.com/sebastianbergmann/exporter/issues",
1508
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
1509
  },
1510
  "funding": [
1511
  {
1513
  "type": "github"
1514
  }
1515
  ],
1516
+ "time": "2021-11-11T14:18:36+00:00"
1517
  },
1518
  {
1519
  "name": "sebastian/global-state",
1975
  ],
1976
  "time": "2020-09-28T06:39:44+00:00"
1977
  },
1978
+ {
1979
+ "name": "squizlabs/php_codesniffer",
1980
+ "version": "3.6.2",
1981
+ "source": {
1982
+ "type": "git",
1983
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
1984
+ "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a"
1985
+ },
1986
+ "dist": {
1987
+ "type": "zip",
1988
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a",
1989
+ "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a",
1990
+ "shasum": ""
1991
+ },
1992
+ "require": {
1993
+ "ext-simplexml": "*",
1994
+ "ext-tokenizer": "*",
1995
+ "ext-xmlwriter": "*",
1996
+ "php": ">=5.4.0"
1997
+ },
1998
+ "require-dev": {
1999
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
2000
+ },
2001
+ "bin": [
2002
+ "bin/phpcs",
2003
+ "bin/phpcbf"
2004
+ ],
2005
+ "type": "library",
2006
+ "extra": {
2007
+ "branch-alias": {
2008
+ "dev-master": "3.x-dev"
2009
+ }
2010
+ },
2011
+ "notification-url": "https://packagist.org/downloads/",
2012
+ "license": [
2013
+ "BSD-3-Clause"
2014
+ ],
2015
+ "authors": [
2016
+ {
2017
+ "name": "Greg Sherwood",
2018
+ "role": "lead"
2019
+ }
2020
+ ],
2021
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
2022
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
2023
+ "keywords": [
2024
+ "phpcs",
2025
+ "standards"
2026
+ ],
2027
+ "support": {
2028
+ "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
2029
+ "source": "https://github.com/squizlabs/PHP_CodeSniffer",
2030
+ "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
2031
+ },
2032
+ "time": "2021-12-12T21:44:58+00:00"
2033
+ },
2034
  {
2035
  "name": "symfony/polyfill-ctype",
2036
+ "version": "v1.24.0",
2037
  "source": {
2038
  "type": "git",
2039
  "url": "https://github.com/symfony/polyfill-ctype.git",
2040
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab"
2041
  },
2042
  "dist": {
2043
  "type": "zip",
2044
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
2045
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab",
2046
  "shasum": ""
2047
  },
2048
  "require": {
2049
  "php": ">=7.1"
2050
  },
2051
+ "provide": {
2052
+ "ext-ctype": "*"
2053
+ },
2054
  "suggest": {
2055
  "ext-ctype": "For best performance"
2056
  },
2095
  "portable"
2096
  ],
2097
  "support": {
2098
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0"
2099
  },
2100
  "funding": [
2101
  {
2111
  "type": "tidelift"
2112
  }
2113
  ],
2114
+ "time": "2021-10-20T20:35:02+00:00"
2115
  },
2116
  {
2117
  "name": "theseer/tokenizer",
vendor/tawk/url-utils/lib/Models/PathPattern.php CHANGED
@@ -6,9 +6,9 @@ use Tawk\Enums\WildcardLocation;
6
  use Tawk\Helpers\PathHelper;
7
 
8
  class PathPattern {
9
- protected array $path_chunks;
10
- protected string $wildcard_location;
11
- protected bool $strict_length_flag;
12
 
13
  /**
14
  * Constructor
6
  use Tawk\Helpers\PathHelper;
7
 
8
  class PathPattern {
9
+ protected $path_chunks;
10
+ protected $wildcard_location;
11
+ protected $strict_length_flag;
12
 
13
  /**
14
  * Constructor
vendor/tawk/url-utils/phpunit.xml DELETED
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit bootstrap="vendor/autoload.php"
4
- colors="true"
5
- verbose="true"
6
- stopOnFailure="false"
7
- testdox="true">
8
- <testsuites>
9
- <testsuite name="match">
10
- <directory>tests</directory>
11
- </testsuite>
12
- </testsuites>
13
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Enums/WildcardLocationTest.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Enums;
4
-
5
- use PHPUnit\Framework\TestCase;
6
- use Tawk\Enums\WildcardLocation;
7
-
8
- class WildcardLocationTest extends TestCase {
9
- /**
10
- * @test
11
- * @group enum_wildcard_location
12
- * @covers ::START
13
- * @small
14
- */
15
- public function check_wildcard_location_start() {
16
- $this->assertEquals(WildcardLocation::START, 'start');
17
- }
18
- /**
19
- * @test
20
- * @group enum_wildcard_location
21
- * @covers ::END
22
- * @small
23
- */
24
- public function check_wildcard_location_end() {
25
- $this->assertEquals(WildcardLocation::END, 'end');
26
- }
27
- /**
28
- * @test
29
- * @group enum_wildcard_location
30
- * @covers ::MIDDLE
31
- * @small
32
- */
33
- public function check_wildcard_location_middle() {
34
- $this->assertEquals(WildcardLocation::MIDDLE, 'middle');
35
- }
36
- /**
37
- * @test
38
- * @group enum_wildcard_location
39
- * @covers ::NONE
40
- * @small
41
- */
42
- public function check_wildcard_location_none() {
43
- $this->assertEquals(WildcardLocation::NONE, 'none');
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Helpers/CommonTest.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Helpers\CommonTest;
4
-
5
- use PHPUnit\Framework\TestCase;
6
- use Tawk\Helpers\Common;
7
-
8
- /**
9
- * @coversDefaultClass \Tawk\Helpers\Common
10
- */
11
- class StrStartsWith extends TestCase {
12
- /**
13
- * @test
14
- * @group text_starts_with
15
- * @covers ::text_starts_with
16
- * @small
17
- */
18
- public function should_be_true_if_provided_text_starts_with() {
19
- $this->assertTrue(Common::text_starts_with('something', 'some'));
20
- }
21
-
22
- /**
23
- * @test
24
- * @group text_starts_with
25
- * @covers ::text_starts_with
26
- * @small
27
- */
28
- public function should_be_false_if_provided_text_does_not_starts_with() {
29
- $this->assertFalse(Common::text_starts_with('something', 'none'));
30
- }
31
- }
32
-
33
-
34
- /**
35
- * @coversDefaultClass \Tawk\Helpers\Common
36
- */
37
- class StrEndsWith extends TestCase {
38
- /**
39
- * @test
40
- * @group text_ends_with
41
- * @covers ::text_ends_with
42
- * @small
43
- */
44
- public function should_be_true_if_provided_text_ends_with() {
45
- $this->assertTrue(Common::text_ends_with('something', 'thing'));
46
- }
47
-
48
- /**
49
- * @test
50
- * @group text_ends_with
51
- * @covers ::text_ends_with
52
- * @small
53
- */
54
- public function should_be_false_if_provided_text_does_not_ends_with() {
55
- $this->assertFalse(Common::text_ends_with('something', 'none'));
56
- }
57
- }
58
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Helpers/PathHelperTest.php DELETED
@@ -1,254 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Helpers\PathHelperTest;
4
-
5
- use PHPUnit\Framework\TestCase;
6
- use Tawk\Enums\WildcardLocation;
7
- use Tawk\Helpers\PathHelper;
8
-
9
- /**
10
- * @coversDefaultClass \Tawk\Helpers\PathHelper
11
- */
12
- class GetWildcardTest extends TestCase {
13
- /**
14
- * @test
15
- * @group get_wildcard
16
- * @covers ::get_wildcard
17
- * @small
18
- */
19
- public function should_return_wildcard_constant() {
20
- $this->assertEquals(PathHelper::get_wildcard(), '*');
21
- }
22
- }
23
-
24
- /**
25
- * @coversDefaultClass \Tawk\Helpers\PathHelper
26
- */
27
- class IsPathTest extends TestCase {
28
- /**
29
- * @test
30
- * @group is_path
31
- * @covers ::is_path
32
- * @small
33
- */
34
- public function should_return_true_if_path_has_leading_slash() {
35
- $this->assertTrue(PathHelper::is_path('/path/to/somewhere'));
36
- }
37
-
38
- /**
39
- * @test
40
- * @group is_path
41
- * @covers ::is_path
42
- * @small
43
- */
44
- public function should_return_true_if_path_has_leading_wildcard() {
45
- $this->assertTrue(PathHelper::is_path('*/to/somewhere'));
46
- }
47
-
48
- /**
49
- * @test
50
- * @group is_path
51
- * @covers ::is_path
52
- * @small
53
- */
54
- public function should_return_false_if_path_has_no_leading_slash_and_wildcard() {
55
- $this->assertFalse(PathHelper::is_path('path/to/somewhere'));
56
- }
57
- }
58
-
59
- /**
60
- * @coversDefaultClass \Tawk\Helpers\PathHelper
61
- */
62
- class PathChunksHasWildcardTest extends TestCase {
63
- /**
64
- * @test
65
- * @group path_chunks_has_wildcard
66
- * @covers ::path_chunks_has_wildcard
67
- * @small
68
- */
69
- public function should_return_true_if_path_chunks_contains_wildcard() {
70
- $path_chunks = array('*', 'to', 'somewhere');
71
- $this->assertTrue(PathHelper::path_chunks_has_wildcard($path_chunks));
72
- }
73
-
74
- /**
75
- * @test
76
- * @group path_chunks_has_wildcard
77
- * @covers ::path_chunks_has_wildcard
78
- * @small
79
- */
80
- public function should_return_false_if_path_chunks_does_not_contain_wildcard() {
81
- $path_chunks = array('path', 'to', 'somewhere');
82
- $this->assertFalse(PathHelper::path_chunks_has_wildcard($path_chunks));
83
- }
84
- }
85
-
86
- /**
87
- * @coversDefaultClass \Tawk\Helpers\PathHelper
88
- */
89
- class IsWildcardTest extends TestCase {
90
- /**
91
- * @test
92
- * @group is_wildcard
93
- * @covers ::is_wildcard
94
- * @small
95
- */
96
- public function should_return_true_if_wildcard() {
97
- $this->assertTrue(PathHelper::is_wildcard('*'));
98
- }
99
-
100
- /**
101
- * @test
102
- * @group is_wildcard
103
- * @covers ::is_wildcard
104
- * @small
105
- */
106
- public function should_return_false_if_not_wildcard() {
107
- $this->assertFalse(PathHelper::is_wildcard('not-wildcard'));
108
- }
109
- }
110
-
111
- /**
112
- * @coversDefaultClass \Tawk\Helpers\PathHelper
113
- */
114
- class GetChunksTest extends TestCase {
115
- /**
116
- * @test
117
- * @group get_chunks
118
- * @covers ::get_chunks
119
- * @small
120
- */
121
- public function should_get_chunks_from_provided_path() {
122
- $this->assertEquals(PathHelper::get_chunks('/path/to/somewhere'), array('path', 'to', 'somewhere'));
123
- }
124
-
125
- /**
126
- * @test
127
- * @group get_chunks
128
- * @covers ::get_chunks
129
- * @small
130
- */
131
- public function should_get_empty_string_array_if_only_provided_with_single_slash() {
132
- $this->assertEquals(PathHelper::get_chunks('/'), array());
133
- }
134
- }
135
-
136
- /**
137
- * @coversDefaultClass \Tawk\Helpers\PathHelper
138
- */
139
- class GetWildcardLocationByChunks extends TestCase {
140
- /**
141
- * @test
142
- * @group get_wildcard_location_by_chunks
143
- * @covers ::get_wildcard_location_by_chunks
144
- * @small
145
- */
146
- public function should_return_start_if_provided_chunks_has_leading_wildcard() {
147
- $path_chunks = array('*', 'to', 'somewhere');
148
- $this->assertEquals(PathHelper::get_wildcard_location_by_chunks($path_chunks), WildcardLocation::START);
149
- }
150
-
151
- /**
152
- * @test
153
- * @group get_wildcard_location_by_chunks
154
- * @covers ::get_wildcard_location_by_chunks
155
- * @small
156
- */
157
- public function should_return_middle_if_provided_chunks_has_wildcard_at_the_middle() {
158
- $path_chunks = array('path', '*', 'somewhere');
159
- $this->assertEquals(PathHelper::get_wildcard_location_by_chunks($path_chunks), WildcardLocation::MIDDLE);
160
- }
161
-
162
- /**
163
- * @test
164
- * @group get_wildcard_location_by_chunks
165
- * @covers ::get_wildcard_location_by_chunks
166
- * @small
167
- */
168
- public function should_return_end_if_provided_chunks_has_trailing_wildcard() {
169
- $path_chunks = array('path', 'to', '*');
170
- $this->assertEquals(PathHelper::get_wildcard_location_by_chunks($path_chunks), WildcardLocation::END);
171
- }
172
-
173
- /**
174
- * @test
175
- * @group get_wildcard_location_by_chunks
176
- * @covers ::get_wildcard_location_by_chunks
177
- * @small
178
- */
179
- public function should_return_none_if_provided_chunks_has_no_wildcard() {
180
- $path_chunks = array('path', 'to', 'somewhere');
181
- $this->assertEquals(PathHelper::get_wildcard_location_by_chunks($path_chunks), WildcardLocation::NONE);
182
- }
183
- }
184
-
185
- /**
186
- * @coversDefaultClass \Tawk\Helpers\PathHelper
187
- */
188
- class CheckStrictLength extends TestCase {
189
- /**
190
- * @test
191
- * @group path_has_strict_length
192
- * @covers ::path_has_strict_length
193
- * @small
194
- */
195
- public function should_be_true_if_provided_path_has_leading_slash_and_wildcard() {
196
- $path = '/*/to/somewhere';
197
- $this->assertTrue(PathHelper::path_has_strict_length($path, WildcardLocation::START));
198
- }
199
-
200
- /**
201
- * @test
202
- * @group path_has_strict_length
203
- * @covers ::path_has_strict_length
204
- * @small
205
- */
206
- public function should_be_true_if_provided_path_has_trailing_wildcard_and_slash() {
207
- $path = '/path/to/*/';
208
- $this->assertTrue(PathHelper::path_has_strict_length($path, WildcardLocation::END));
209
- }
210
-
211
- /**
212
- * @test
213
- * @group path_has_strict_length
214
- * @covers ::path_has_strict_length
215
- * @small
216
- */
217
- public function should_be_false_if_provided_path_has_leading_wildcard_and_slash() {
218
- $path = '*/to/somewhere';
219
- $this->assertFalse(PathHelper::path_has_strict_length($path, WildcardLocation::START));
220
- }
221
-
222
- /**
223
- * @test
224
- * @group path_has_strict_length
225
- * @covers ::path_has_strict_length
226
- * @small
227
- */
228
- public function should_be_false_if_provided_path_has_trailing_slash_and_wildcard() {
229
- $path = '/path/to/*';
230
- $this->assertFalse(PathHelper::path_has_strict_length($path, WildcardLocation::END));
231
- }
232
-
233
- /**
234
- * @test
235
- * @group path_has_strict_length
236
- * @covers ::path_has_strict_length
237
- * @small
238
- */
239
- public function should_be_false_if_provided_path_has_no_leading_or_trailing_slash_and_wildcard() {
240
- $path = '/path/*/somewhere';
241
- $this->assertFalse(PathHelper::path_has_strict_length($path, WildcardLocation::MIDDLE));
242
- }
243
-
244
- /**
245
- * @test
246
- * @group path_has_strict_length
247
- * @covers ::path_has_strict_length
248
- * @small
249
- */
250
- public function should_be_false_if_provided_path_has_different_wildcard_location_on_path() {
251
- $path = '/path/somewhere/*/';
252
- $this->assertFalse(PathHelper::path_has_strict_length($path, WildcardLocation::START));
253
- }
254
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Helpers/UrlHelperTest.php DELETED
@@ -1,101 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Helpers\UrlHelperTest;
4
-
5
- use PHPUnit\Framework\TestCase;
6
-
7
- use Tawk\Helpers\UrlHelper;
8
-
9
- /**
10
- * @coversDefaultClass \Tawk\Helpers\UrlHelper
11
- */
12
- class ParsePatternUrl extends Testcase {
13
- /**
14
- * @test
15
- * @group parse_url
16
- * @covers ::parse_url
17
- * @small
18
- */
19
- public function should_parse_provided_pattern_url() {
20
- $pattern_url = 'http://www.example.com:80/path/to/somewhere';
21
- $this->assertEquals(UrlHelper::parse_url($pattern_url), array(
22
- 'scheme' => 'http',
23
- 'host' => 'www.example.com',
24
- 'port' => '80',
25
- 'path' => '/path/to/somewhere'
26
- ));
27
- }
28
-
29
- /**
30
- * @test
31
- * @group parse_url
32
- * @covers ::parse_url
33
- * @small
34
- */
35
- public function should_parse_provided_pattern_url_without_scheme() {
36
- $pattern_url = 'www.example.com:80/path/to/somewhere';
37
- $this->assertEquals(UrlHelper::parse_url($pattern_url), array(
38
- 'host' => 'www.example.com',
39
- 'port' => '80',
40
- 'path' => '/path/to/somewhere'
41
- ));
42
- }
43
-
44
- /**
45
- * @test
46
- * @group parse_url
47
- * @covers ::parse_url
48
- * @small
49
- */
50
- public function should_parse_provided_pattern_url_without_port() {
51
- $pattern_url = 'http://www.example.com/path/to/somewhere';
52
- $this->assertEquals(UrlHelper::parse_url($pattern_url), array(
53
- 'scheme' => 'http',
54
- 'host' => 'www.example.com',
55
- 'path' => '/path/to/somewhere'
56
- ));
57
- }
58
-
59
- /**
60
- * @test
61
- * @group parse_url
62
- * @covers ::parse_url
63
- * @small
64
- */
65
- public function should_parse_provided_pattern_url_without_path() {
66
- $pattern_url = 'http://www.example.com:80';
67
- $this->assertEquals(UrlHelper::parse_url($pattern_url), array(
68
- 'scheme' => 'http',
69
- 'host' => 'www.example.com',
70
- 'port' => '80',
71
- 'path' => '/'
72
- ));
73
- }
74
-
75
- /**
76
- * @test
77
- * @group parse_url
78
- * @covers ::parse_url
79
- * @small
80
- */
81
- public function should_parse_provided_pattern_path() {
82
- $pattern_path = '/path/to/somewhere';
83
- $this->assertEquals(UrlHelper::parse_url($pattern_path), array(
84
- 'path' => '/path/to/somewhere'
85
- ));
86
- }
87
-
88
- /**
89
- * @test
90
- * @group parse_url
91
- * @covers ::parse_url
92
- * @small
93
- */
94
- public function should_parse_set_host_if_provided_pattern_path_has_no_leading_slash() {
95
- $pattern_path = 'path/to/somewhere';
96
- $this->assertEquals(UrlHelper::parse_url($pattern_path), array(
97
- 'host' => 'path',
98
- 'path' => '/to/somewhere'
99
- ));
100
- }
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Models/PathPatternTest.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Models\PathPatternTest;
4
-
5
- use PHPUnit\Framework\TestCase;
6
- use Tawk\Enums\WildcardLocation;
7
- use Tawk\Models\PathPattern;
8
-
9
- /**
10
- * @coversDefaultClass \Tawk\Models\PathPatternTest
11
- */
12
- class CreateInstanceFromPath extends TestCase {
13
- /**
14
- * @test
15
- * @group create_instance_from_path
16
- * @covers ::create_instance_from_path
17
- * @small
18
- */
19
- public function should_create_path_pattern_instance_from_provided_path() {
20
- $path_pattern = PathPattern::create_instance_from_path('/path/to/somewhere');
21
- $this->assertInstanceOf(PathPattern::class, $path_pattern);
22
- }
23
- }
24
-
25
- /**
26
- * @coversDefaultClass \Tawk\Models\PathPatternTest
27
- */
28
- class HasWildcard extends TestCase {
29
- /**
30
- * @test
31
- * @group has_wildcard
32
- * @covers ::has_wildcard
33
- * @small
34
- */
35
- public function should_be_true_if_path_provided_has_wildcard() {
36
- $path_pattern = PathPattern::create_instance_from_path('/path/to/*');
37
- $this->assertTrue($path_pattern->has_wildcard());
38
- }
39
-
40
- /**
41
- * @test
42
- * @group has_wildcard
43
- * @covers ::has_wildcard
44
- * @small
45
- */
46
- public function should_be_false_if_path_provided_does_not_have_wildcard() {
47
- $path_pattern = PathPattern::create_instance_from_path('/path/to/somewhere');
48
- $this->assertFalse($path_pattern->has_wildcard());
49
- }
50
- }
51
-
52
- /**
53
- * @coversDefaultClass \Tawk\Models\PathPatternTest
54
- */
55
- class HasStrictLength extends TestCase {
56
- /**
57
- * @test
58
- * @group has_strict_length
59
- * @covers ::has_strict_length
60
- * @small
61
- */
62
- public function should_be_true_if_pattern_provided_has_leading_slash_and_wildcard() {
63
- $path_pattern = PathPattern::create_instance_from_path('/*/to/somewhere');
64
- $this->assertTrue($path_pattern->has_strict_length());
65
- }
66
-
67
- /**
68
- * @test
69
- * @group has_strict_length
70
- * @covers ::has_strict_length
71
- * @small
72
- */
73
- public function should_be_true_if_pattern_provided_has_trailing_wildcard_and_slash() {
74
- $path_pattern = PathPattern::create_instance_from_path('/path/to/*/');
75
- $this->assertTrue($path_pattern->has_strict_length());
76
- }
77
-
78
- /**
79
- * @test
80
- * @group has_strict_length
81
- * @covers ::has_strict_length
82
- * @small
83
- */
84
- public function should_be_false_if_pattern_provided_has_no_leading_or_trailing_slash_and_wildcard() {
85
- $path_pattern = PathPattern::create_instance_from_path('/path/to/somewhere');
86
- $this->assertFalse($path_pattern->has_strict_length());
87
- }
88
- }
89
-
90
- /**
91
- * @coversDefaultClass \Tawk\Models\PathPatternTest
92
- */
93
- class GetChunks extends TestCase {
94
- /**
95
- * @test
96
- * @group get_chunks
97
- * @covers ::get_chunks
98
- * @small
99
- */
100
- public function should_provide_path_in_chunks() {
101
- $path_pattern = PathPattern::create_instance_from_path('/path/to/somewhere');
102
- $this->assertEquals($path_pattern->get_chunks(), array('path', 'to', 'somewhere'));
103
- }
104
- }
105
-
106
- /**
107
- * @coversDefaultClass \Tawk\Models\PathPatternTest
108
- */
109
- class GetWildcardLocation extends TestCase {
110
- /**
111
- * @test
112
- * @group get_wildcard_location
113
- * @covers ::get_wildcard_location
114
- * @small
115
- */
116
- public function should_provide_wildcard_location() {
117
- $path_pattern = PathPattern::create_instance_from_path('/path/*/somewhere');
118
- $this->assertEquals($path_pattern->get_wildcard_location(), WildcardLocation::MIDDLE);
119
- }
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Modules/PathPatternMatcherTest.php DELETED
@@ -1,543 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Modules;
4
-
5
- use PHPUnit\Framework\TestCase;
6
- use Tawk\Models\PathPattern;
7
- use Tawk\Modules\PathPatternMatcher;
8
-
9
- /**
10
- * @coversDefaultClass \Tawk\Modules\PathPatternMatcher
11
- */
12
- class PathMatchTest extends TestCase {
13
- /**
14
- * @test
15
- * @group match_path_no_wildcard
16
- * @covers ::match
17
- * @small
18
- */
19
- public function should_match_similar_path_and_pattern() {
20
- $path_chunks = array('path', 'to', 'somewhere');
21
- $pattern_chunks = array(
22
- PathPattern::create_instance_from_path('/path/to/somewhere')
23
- );
24
-
25
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
26
- }
27
-
28
- /**
29
- * @test
30
- * @group match_path_no_wildcard
31
- * @covers ::match
32
- * @small
33
- */
34
- public function should_match_both_empty_path_and_pattern() {
35
- $path_chunks = array();
36
- $pattern_chunks = array(
37
- PathPattern::create_instance_from_path('')
38
- );
39
-
40
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
41
- }
42
-
43
- /**
44
- * @test
45
- * @group match_path_no_wildcard
46
- * @covers ::match
47
- * @small
48
- */
49
- public function should_not_match_different_path_and_pattern() {
50
- $path_chunks = array('path', 'to', 'somewhere');
51
- $pattern_chunks = array(
52
- PathPattern::create_instance_from_path('/path/different/path')
53
- );
54
-
55
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
56
- }
57
-
58
- /**
59
- * @test
60
- * @group match_path_no_wildcard
61
- * @covers ::match
62
- * @small
63
- */
64
- public function should_not_match_path_longer_than_pattern() {
65
- $path_chunks = array('path', 'to', 'somewhere', 'longer');
66
- $pattern_chunks = array(
67
- PathPattern::create_instance_from_path('/path/to/somewhere')
68
- );
69
-
70
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
71
- }
72
-
73
- /**
74
- * @test
75
- * @group match_path_no_wildcard
76
- * @covers ::match
77
- * @small
78
- */
79
- public function should_not_match_path_shorter_than_pattern() {
80
- $path_chunks = array('path', 'to', 'somewhere');
81
- $pattern_chunks = array(
82
- PathPattern::create_instance_from_path('/path/to/somewhere/longer')
83
- );
84
-
85
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
86
- }
87
-
88
- /**
89
- * @test
90
- * @group match_path_single_wildcard
91
- * @covers ::match
92
- * @small
93
- */
94
- public function should_match_path_with_single_wildcard_pattern() {
95
- $path_chunks = array('path', 'to', 'somewhere');
96
- $pattern_chunks = array(
97
- PathPattern::create_instance_from_path('*')
98
- );
99
-
100
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
101
- }
102
-
103
- /**
104
- * @test
105
- * @group test
106
- * @covers ::match
107
- * @small
108
- */
109
- public function should_match_empty_path_with_single_wildcard_pattern() {
110
- $path_chunks = array();
111
- $pattern_chunks = array(
112
- PathPattern::create_instance_from_path('*')
113
- );
114
-
115
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
116
- }
117
-
118
- /**
119
- * @test
120
- * @group match_path_wildcard_start
121
- * @covers ::match
122
- * @small
123
- */
124
- public function should_match_path_with_leading_wildcard_pattern() {
125
- $path_chunks = array('path', 'to', 'somewhere');
126
- $pattern_chunks = array(
127
- PathPattern::create_instance_from_path('*/to/somewhere')
128
- );
129
-
130
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
131
- }
132
-
133
- /**
134
- * @test
135
- * @group match_path_wildcard_start
136
- * @covers ::match
137
- * @small
138
- */
139
- public function should_match_path_with_leading_wildcard_pattern_that_covers_multiple_path_chunks() {
140
- $path_chunks = array('path', 'to', 'somewhere', 'longer');
141
- $pattern_chunks = array(
142
- PathPattern::create_instance_from_path('*/longer')
143
- );
144
-
145
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
146
- }
147
-
148
- /**
149
- * @test
150
- * @group match_path_wildcard_start
151
- * @covers ::match
152
- * @small
153
- */
154
- public function should_not_match_path_longer_than_the_pattern_with_leading_wildcard() {
155
- $path_chunks = array('path', 'to', 'somewhere', 'longer');
156
- $pattern_chunks = array(
157
- PathPattern::create_instance_from_path('*/to/somewhere')
158
- );
159
-
160
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
161
- }
162
-
163
- /**
164
- * @test
165
- * @group match_path_wildcard_start
166
- * @covers ::match
167
- * @small
168
- */
169
- public function should_not_match_shorter_path_with_leading_wildcard_pattern_that_has_different_ending_path() {
170
- $path_chunks = array('path', 'to', 'somewhere');
171
- $pattern_chunks = array(
172
- PathPattern::create_instance_from_path('*/to/somewhere/longer')
173
- );
174
-
175
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
176
- }
177
-
178
- /**
179
- * @test
180
- * @group match_path_wildcard_start
181
- * @covers ::match
182
- * @small
183
- */
184
- public function should_not_match_different_ending_path_with_leading_wildcard_pattern_that_covers_multiple_path_chunks() {
185
- $path_chunks = array('path', 'to', 'somewhere', 'longer', 'and', 'different');
186
- $pattern_chunks = array(
187
- PathPattern::create_instance_from_path('*/longer')
188
- );
189
-
190
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
191
- }
192
-
193
- /**
194
- * @test
195
- * @group match_path_wildcard_start
196
- * @covers ::match
197
- * @small
198
- */
199
- public function should_not_match_path_with_leading_wildcard_pattern_that_covers_multiple_path_chunks_and_has_different_ending_path() {
200
- $path_chunks = array('path', 'to', 'somewhere', 'longer');
201
- $pattern_chunks = array(
202
- PathPattern::create_instance_from_path('*/longer/and/different')
203
- );
204
-
205
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
206
- }
207
-
208
- /**
209
- * @test
210
- * @group match_path_wildcard_start
211
- * @covers ::match
212
- * @small
213
- */
214
- public function should_not_match_path_with_leading_wildcard_pattern_that_has_no_similarities() {
215
- $path_chunks = array('path', 'to', 'somewhere', 'longer', 'and', 'different');
216
- $pattern_chunks = array(
217
- PathPattern::create_instance_from_path('*/longer')
218
- );
219
-
220
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
221
- }
222
-
223
- /**
224
- * @test
225
- * @group match_path_wildcard_start
226
- * @covers ::match
227
- * @small
228
- */
229
- public function should_not_match_empty_path_with_leading_wildcard_pattern() {
230
- $path_chunks = array();
231
- $pattern_chunks = array(
232
- PathPattern::create_instance_from_path('*/to/somewhere')
233
- );
234
-
235
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
236
- }
237
-
238
- /**
239
- * @test
240
- * @group match_path_wildcard_end
241
- * @covers ::match
242
- * @small
243
- */
244
- public function should_match_path_and_trailing_wildcard_pattern() {
245
- $path_chunks = array('path', 'to', 'somewhere');
246
- $pattern_chunks = array(
247
- PathPattern::create_instance_from_path('/path/to/*')
248
- );
249
-
250
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
251
- }
252
-
253
- /**
254
- * @test
255
- * @group match_path_wildcard_end
256
- * @covers ::match
257
- * @small
258
- */
259
- public function should_match_path_and_trailing_wildcard_pattern_that_covers_multiple_path_chunks() {
260
- $path_chunks = array('path', 'to', 'somewhere');
261
- $pattern_chunks = array(
262
- PathPattern::create_instance_from_path('/path/*')
263
- );
264
-
265
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
266
- }
267
-
268
- /**
269
- * @test
270
- * @group match_path_wildcard_end
271
- * @covers ::match
272
- * @small
273
- */
274
- public function should_not_match_path_and_trailing_wildcard_pattern_that_contains_the_full_path() {
275
- $path_chunks = array('path', 'to', 'somewhere');
276
- $pattern_chunks = array(
277
- PathPattern::create_instance_from_path('/path/to/somewhere/*')
278
- );
279
-
280
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
281
- }
282
-
283
- /**
284
- * @test
285
- * @group match_path_wildcard_end
286
- * @covers ::match
287
- * @small
288
- */
289
- public function should_not_match_path_with_trailing_wildcard_pattern_that_has_different_starting_path() {
290
- $path_chunks = array('path', 'to', 'somewhere');
291
- $pattern_chunks = array(
292
- PathPattern::create_instance_from_path('/different/path/*')
293
- );
294
-
295
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
296
- }
297
-
298
- /**
299
- * @test
300
- * @group match_path_wildcard_end
301
- * @covers ::match
302
- * @small
303
- */
304
- public function should_not_match_empty_path_with_trailing_wildcard_pattern() {
305
- $path_chunks = array();
306
- $pattern_chunks = array(
307
- PathPattern::create_instance_from_path('/different/path/*')
308
- );
309
-
310
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
311
- }
312
-
313
- /**
314
- * @test
315
- * @group match_path_wildcard_end
316
- * @covers ::match
317
- * @small
318
- */
319
- public function should_not_match_path_with_trailing_wildcard_pattern_that_contains_the_full_path_but_has_additional_path() {
320
- $path_chunks = array('path', 'to', 'somewhere');
321
- $pattern_chunks = array(
322
- PathPattern::create_instance_from_path('/path/to/somewhere/longer/*')
323
- );
324
-
325
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
326
- }
327
-
328
- /**
329
- * @test
330
- * @group match_path_wildcard_middle
331
- * @covers ::match
332
- * @small
333
- */
334
- public function should_match_path_with_middle_wildcard_pattern() {
335
- $path_chunks = array('path', 'to', 'somewhere');
336
- $pattern_chunks = array(
337
- PathPattern::create_instance_from_path('/path/*/somewhere')
338
- );
339
-
340
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
341
- }
342
-
343
- /**
344
- * @test
345
- * @group match_path_wildcard_middle
346
- * @covers ::match
347
- * @small
348
- */
349
- public function should_match_path_with_multiple_middle_wildcard_pattern() {
350
- $path_chunks = array('path', 'to', 'some', 'different', 'place');
351
- $pattern_chunks = array(
352
- PathPattern::create_instance_from_path('/path/*/some/*/place')
353
- );
354
-
355
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
356
- }
357
-
358
- /**
359
- * @test
360
- * @group match_path_wildcard_middle
361
- * @covers ::match
362
- * @small
363
- */
364
- public function should_match_path_with_multiple_succeeding_middle_wildcard_pattern() {
365
- $path_chunks = array('path', 'to', 'somewhere', 'different');
366
- $pattern_chunks = array(
367
- PathPattern::create_instance_from_path('/path/*/*/different')
368
- );
369
-
370
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
371
- }
372
-
373
- /**
374
- * @test
375
- * @group match_path_wildcard_middle
376
- * @covers ::match
377
- * @small
378
- */
379
- public function should_not_match_path_with_middle_wildcard_pattern_that_has_different_start_and_end_paths() {
380
- $path_chunks = array('path', 'to', 'somewhere');
381
- $pattern_chunks = array(
382
- PathPattern::create_instance_from_path('/different/*/path')
383
- );
384
-
385
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
386
- }
387
-
388
- /**
389
- * @test
390
- * @group match_path_with_leading_slash_and_wildcard
391
- * @covers ::match()
392
- * @small
393
- */
394
- public function should_match_path_with_leading_slash_and_wildcard_pattern() {
395
- $path_chunks = array('path', 'to', 'somewhere');
396
- $pattern_chunks = array(
397
- PathPattern::create_instance_from_path('/*/to/somewhere')
398
- );
399
-
400
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
401
- }
402
-
403
- /**
404
- * @test
405
- * @group match_path_with_leading_slash_and_wildcard
406
- * @covers ::match()
407
- * @small
408
- */
409
- public function should_not_match_multiple_leading_path_with_leading_slash_and_wildcard_pattern() {
410
- $path_chunks = array('more', 'path', 'to', 'somewhere');
411
- $pattern_chunks = array(
412
- PathPattern::create_instance_from_path('/*/to/somewhere')
413
- );
414
-
415
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
416
- }
417
-
418
- /**
419
- * @test
420
- * @group match_path_with_trailing_slash_and_wildcard
421
- * @covers ::match()
422
- * @small
423
- */
424
- public function should_match_path_with_trailing_slash_and_wildcard_pattern() {
425
- $path_chunks = array('path', 'to', 'somewhere');
426
- $pattern_chunks = array(
427
- PathPattern::create_instance_from_path('/path/to/*/')
428
- );
429
-
430
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
431
- }
432
-
433
- /**
434
- * @test
435
- * @group match_path_with_trailing_slash_and_wildcard
436
- * @covers ::match()
437
- * @small
438
- */
439
- public function should_not_match_multiple_trailing_path_with_trailing_slash_and_wildcard_pattern() {
440
- $path_chunks = array('path', 'to', 'somewhere', 'safe');
441
- $pattern_chunks = array(
442
- PathPattern::create_instance_from_path('/path/to/*/')
443
- );
444
-
445
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
446
- }
447
-
448
-
449
- /**
450
- * @test
451
- * @group match_path_with_leading_and_middle_wildcard
452
- * @covers ::match()
453
- * @small
454
- */
455
- public function should_match_path_with_leading_and_middle_wildcard_pattern() {
456
- $path_chunks = array('some', 'other', 'path', 'to', 'somewhere');
457
- $pattern_chunks = array(
458
- PathPattern::create_instance_from_path('*/path/*/somewhere')
459
- );
460
-
461
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
462
- }
463
-
464
- /**
465
- * @test
466
- * @group match_path_with_leading_and_middle_wildcard
467
- * @covers ::match()
468
- * @small
469
- */
470
- public function should_not_match_multiple_middle_path_with_leading_and_middle_wildcard_pattern() {
471
- $path_chunks = array('some', 'other', 'path', 'leads', 'to', 'somewhere');
472
- $pattern_chunks = array(
473
- PathPattern::create_instance_from_path('*/path/*/somewhere')
474
- );
475
-
476
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
477
- }
478
-
479
-
480
- /**
481
- * @test
482
- * @group match_path_with_trailing_and_middle_wildcard
483
- * @covers ::match()
484
- * @small
485
- */
486
- public function should_match_path_with_trailing_and_middle_wildcard_pattern() {
487
- $path_chunks = array('path', 'to', 'another', 'place');
488
- $pattern_chunks = array(
489
- PathPattern::create_instance_from_path('/path/*/another/*')
490
- );
491
-
492
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
493
- }
494
-
495
- /**
496
- * @test
497
- * @group match_path_with_trailing_and_middle_wildcard
498
- * @covers ::match()
499
- * @small
500
- */
501
- public function should_not_match_multiple_middle_path_with_trailing_and_middle_wildcard_pattern() {
502
- $path_chunks = array('path', 'leads', 'to', 'another', 'place');
503
- $pattern_chunks = array(
504
- PathPattern::create_instance_from_path('/path/*/another/*')
505
- );
506
-
507
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
508
- }
509
-
510
- /**
511
- * @test
512
- * @group match_path_multiple
513
- * @covers ::match
514
- * @small
515
- */
516
- public function should_match_path_with_one_of_the_provided_patterns() {
517
- $path_chunks = array('path', 'to', 'somewhere');
518
- $pattern_chunks = array(
519
- PathPattern::create_instance_from_path('/path/*/elsewhere'),
520
- PathPattern::create_instance_from_path('/path/on/*'),
521
- PathPattern::create_instance_from_path('*/to/somewhere')
522
- );
523
-
524
- $this->assertTrue(PathPatternMatcher::match($path_chunks, $pattern_chunks));
525
- }
526
-
527
- /**
528
- * @test
529
- * @group match_path_multiple
530
- * @covers ::match
531
- * @small
532
- */
533
- public function should_not_match_path_with_any_of_the_provided_patterns_that_are_different() {
534
- $path_chunks = array('path', 'to', 'somewhere');
535
- $pattern_chunks = array(
536
- PathPattern::create_instance_from_path('/path/to/elsewhere'),
537
- PathPattern::create_instance_from_path('/path/is/somewhere'),
538
- PathPattern::create_instance_from_path('*/others')
539
- );
540
-
541
- $this->assertFalse(PathPatternMatcher::match($path_chunks, $pattern_chunks));
542
- }
543
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/tawk/url-utils/tests/Modules/UrlPatternMatcherTest.php DELETED
@@ -1,375 +0,0 @@
1
- <?php
2
-
3
- namespace Tawk\Tests\Modules;
4
-
5
- use PHPUnit\Framework\TestCase;
6
- use Tawk\Modules\UrlPatternMatcher;
7
-
8
- /**
9
- * @coversDefaultClass \Tawk\Modules\UrlPatternMatcher
10
- */
11
- class UrlMatchTest extends TestCase {
12
- /**
13
- * @test
14
- * @group match_url
15
- * @covers ::match
16
- * @small
17
- */
18
- public function should_match_similar_url() {
19
- $url = 'http://www.example.com';
20
- $pattern = array('http://www.example.com');
21
- $result = UrlPatternMatcher::match($url, $pattern);
22
-
23
- $this->assertTrue($result);
24
- }
25
-
26
- /**
27
- * @test
28
- * @group match_url_scheme
29
- * @covers ::match
30
- * @small
31
- */
32
- public function should_match_url_with_pattern_that_has_no_scheme() {
33
- $url = 'http://www.example.com';
34
- $pattern = array('www.example.com');
35
- $result = UrlPatternMatcher::match($url, $pattern);
36
-
37
- $this->assertTrue($result);
38
- }
39
-
40
- /**
41
- * @test
42
- * @group match_url_scheme
43
- * @covers ::match
44
- * @small
45
- */
46
- public function should_not_match_url_with_different_pattern_scheme() {
47
- $url = 'http://www.example.com';
48
- $pattern = array('https://www.example.com');
49
- $result = UrlPatternMatcher::match($url, $pattern);
50
-
51
- $this->assertFalse($result);
52
- }
53
-
54
- /**
55
- * @test
56
- * @group match_url_host
57
- * @covers ::match
58
- * @small
59
- */
60
- public function should_not_match_different_url_host() {
61
- $url = 'http://www.example.com';
62
- $pattern = array('http://www.tawk.to');
63
- $result = UrlPatternMatcher::match($url, $pattern);
64
-
65
- $this->assertFalse($result);
66
- }
67
-
68
- /**
69
- * @test
70
- * @group match_url_host
71
- * @covers ::match
72
- */
73
- public function should_match_url_with_ip_address_as_host() {
74
- $url = 'http://192.168.0.1/path/to/somewhere';
75
- $pattern = array('http://192.168.0.1/path/to/somewhere');
76
- $result = UrlPatternMatcher::match($url, $pattern);
77
-
78
- $this->assertTrue($result);
79
- }
80
-
81
- /**
82
- * @test
83
- * @group match_url_host
84
- * @covers ::match
85
- * @small
86
- */
87
- public function should_match_localhost() {
88
- $url = 'http://localhost';
89
- $pattern = array('http://localhost');
90
- $result = UrlPatternMatcher::match($url, $pattern);
91
-
92
- $this->assertTrue($result);
93
- }
94
-
95
- /**
96
- * @test
97
- * @group match_url_host
98
- * @covers ::match
99
- * @small
100
- */
101
- public function should_match_localhost_without_scheme() {
102
- $url = 'http://localhost';
103
- $pattern = array('localhost');
104
- $result = UrlPatternMatcher::match($url, $pattern);
105
-
106
- $this->assertTrue($result);
107
- }
108
-
109
- /**
110
- * @test
111
- * @group match_url_port
112
- * @covers ::match
113
- * @small
114
- */
115
- public function should_match_similar_url_port() {
116
- $url = 'http://www.example.com:80';
117
- $pattern = array('http://www.example.com:80');
118
- $result = UrlPatternMatcher::match($url, $pattern);
119
-
120
- $this->assertTrue($result);
121
- }
122
-
123
- /**
124
- * @test
125
- * @group match_url_port
126
- * @covers ::match
127
- * @small
128
- */
129
- public function should_not_match_different_url_port() {
130
- $url = 'http://www.example.com:80';
131
- $pattern = array('http://www.example.com:8000');
132
- $result = UrlPatternMatcher::match($url, $pattern);
133
-
134
- $this->assertFalse($result);
135
- }
136
-
137
- /**
138
- * @test
139
- * @group match_url_with_full_url_and_path
140
- * @covers ::match
141
- * @small
142
- */
143
- public function should_match_similar_url_and_pattern() {
144
- $url = 'http://www.example.com/path/to/somewhere';
145
- $pattern = array('http://www.example.com/path/to/somewhere');
146
- $result = UrlPatternMatcher::match($url, $pattern);
147
-
148
- $this->assertTrue($result);
149
- }
150
-
151
- /**
152
- * @test
153
- * @group match_url_with_full_url_and_path
154
- * @covers ::match
155
- * @small
156
- */
157
- public function should_match_url_with_full_url_and_leading_wildcard_path_pattern() {
158
- $url = 'http://www.example.com/path/to/somewhere';
159
- $pattern = array('http://www.example.com/*/to/somewhere');
160
- $result = UrlPatternMatcher::match($url, $pattern);
161
-
162
- $this->assertTrue($result);
163
- }
164
-
165
- /**
166
- * @test
167
- * @group match_url_with_full_url_and_path
168
- * @covers ::match
169
- * @small
170
- */
171
- public function should_match_url_with_full_url_and_trailing_wildcard_path_pattern() {
172
- $url = 'http://www.example.com/path/to/somewhere';
173
- $pattern = array('http://www.example.com/path/to/*');
174
- $result = UrlPatternMatcher::match($url, $pattern);
175
-
176
- $this->assertTrue($result);
177
- }
178
-
179
- /**
180
- * @test
181
- * @group match_url_with_full_url_and_path
182
- * @covers ::match
183
- * @small
184
- */
185
- public function should_match_url_with_full_url_and_middle_wildcard_path_pattern() {
186
- $url = 'http://www.example.com/path/to/somewhere';
187
- $pattern = array('http://www.example.com/path/*/somewhere');
188
- $result = UrlPatternMatcher::match($url, $pattern);
189
-
190
- $this->assertTrue($result);
191
- }
192
-
193
- /**
194
- * @test
195
- * @group match_url_with_full_url_and_path
196
- * @covers ::match
197
- * @small
198
- */
199
- public function should_match_url_with_full_url_and_only_wildcard_path_pattern() {
200
- $url = 'http://www.example.com/path/to/somewhere';
201
- $pattern = array('http://www.example.com/*');
202
- $result = UrlPatternMatcher::match($url, $pattern);
203
-
204
- $this->assertTrue($result);
205
- }
206
-
207
- /**
208
- * @test
209
- * @group match_url_with_full_url_and_path
210
- * @covers ::match
211
- * @small
212
- */
213
- public function should_match_url_and_empty_path_with_full_url_and_only_wildcard_path_pattern() {
214
- $url = 'http://www.example.com/';
215
- $pattern = array('http://www.example.com/*');
216
- $result = UrlPatternMatcher::match($url, $pattern);
217
-
218
- $this->assertTrue($result);
219
- }
220
-
221
- /**
222
- * @test
223
- * @group match_url_with_path_only
224
- * @covers ::match
225
- * @small
226
- */
227
- public function should_match_url_with_path_only_pattern() {
228
- $url = 'http://www.example.com/path/to/somewhere';
229
- $pattern = array('/path/to/somewhere');
230
- $result = UrlPatternMatcher::match($url, $pattern);
231
-
232
- $this->assertTrue($result);
233
- }
234
-
235
- /**
236
- * @test
237
- * @group match_url_with_path_only
238
- * @covers ::match
239
- * @small
240
- */
241
- public function should_match_url_with_leading_wildcard_pattern_path() {
242
- $url = 'http://www.example.com/path/to/somewhere';
243
- $pattern = array('*/to/somewhere');
244
- $result = UrlPatternMatcher::match($url, $pattern);
245
-
246
- $this->assertTrue($result);
247
- }
248
-
249
- /**
250
- * @test
251
- * @group match_url_with_path_only
252
- * @covers ::match
253
- * @small
254
- */
255
- public function should_match_url_with_trailing_wildcard_pattern_path() {
256
- $url = 'http://www.example.com/path/to/somewhere';
257
- $pattern = array('/path/to/*');
258
- $result = UrlPatternMatcher::match($url, $pattern);
259
-
260
- $this->assertTrue($result);
261
- }
262
-
263
- /**
264
- * @test
265
- * @group match_url_with_path_only
266
- * @covers ::match
267
- * @small
268
- */
269
- public function should_match_url_with_middle_wildcard_pattern_path() {
270
- $url = 'http://www.example.com/path/to/somewhere';
271
- $pattern = array('/path/*/somewhere');
272
- $result = UrlPatternMatcher::match($url, $pattern);
273
-
274
- $this->assertTrue($result);
275
- }
276
-
277
- /**
278
- * @test
279
- * @group match_url_with_path_only
280
- * @covers ::match
281
- * @small
282
- */
283
- public function should_match_url_and_empty_path_with_wildcard_only_pattern_path() {
284
- $url = 'http://www.example.com';
285
- $pattern = array('*');
286
- $result = UrlPatternMatcher::match($url, $pattern);
287
-
288
- $this->assertTrue($result);
289
- }
290
-
291
- /**
292
- * @test
293
- * @group match_url_with_path_only
294
- * @covers ::match
295
- * @small
296
- */
297
- public function should_match_url_with_wildcard_only_pattern_path() {
298
- $url = 'http://www.example.com/path/to/somewhere';
299
- $pattern = array('*');
300
- $result = UrlPatternMatcher::match($url, $pattern);
301
-
302
- $this->assertTrue($result);
303
- }
304
-
305
- /**
306
- * @test
307
- * @group match_url_with_path_only
308
- * @covers ::match
309
- * @small
310
- */
311
- public function should_not_match_url_with_pattern_not_having_leading_slash_or_wildcard() {
312
- $url = 'http://www.example.com/path/to/somewhere';
313
- $pattern = array('path/to/somewhere');
314
- $result = UrlPatternMatcher::match($url, $pattern);
315
-
316
- $this->assertFalse($result);
317
- }
318
-
319
- /**
320
- * @test
321
- * @group match_url_multiple
322
- * @covers ::match
323
- * @small
324
- */
325
- public function should_match_url_with_multiple_patterns() {
326
- $url = 'http://www.example.com/path/to/somewhere';
327
- $pattern = array(
328
- 'path/to/somewhere',
329
- 'http://www.example.com/path/to/*',
330
- 'http://www.example.com/*/path/should/lead/to/somewhere',
331
- 'this/*/should/lead/to/somewhere'
332
- );
333
- $result = UrlPatternMatcher::match($url, $pattern);
334
-
335
- $this->assertTrue($result);
336
- }
337
-
338
- /**
339
- * @test
340
- * @group match_url_multiple
341
- * @covers ::match
342
- * @small
343
- */
344
- public function should_match_url_with_multiple_patterns_that_has_one_similar_pattern() {
345
- $url = 'http://www.example.com/path/to/somewhere';
346
- $pattern = array(
347
- '/this/path/should/lead/to/elsewhere',
348
- 'http://www.example.com/this/path/should/lead/in/*',
349
- 'http://www.example.com/*/path/should/lead/to/me',
350
- '/path/*/somewhere' // valid
351
- );
352
- $result = UrlPatternMatcher::match($url, $pattern);
353
-
354
- $this->assertTrue($result);
355
- }
356
-
357
- /**
358
- * @test
359
- * @group match_url_multiple
360
- * @covers ::match
361
- * @small
362
- */
363
- public function should_not_match_url_with_multiple_patterns_that_are_all_different() {
364
- $url = 'http://www.example.com/path/to/somewhere';
365
- $pattern = array(
366
- 'this/path/should/lead/to/elsewhere',
367
- 'http://www.example.com/this/path/should/lead/in/*',
368
- 'http://www.example.com/*/path/should/lead/to/me',
369
- 'this/*/shouldnot/lead/to/somewhere'
370
- );
371
- $result = UrlPatternMatcher::match($url, $pattern);
372
-
373
- $this->assertFalse($result);
374
- }
375
- }