PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.5
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.5
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / matthiasmullie / path-converter / tests / NoConverterTest.php

NoConverterTest.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/matthiasmullie/path-converter/tests/NoConverterTest.php

74 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MatthiasMullie\PathConverter\Tests;
4
5 use MatthiasMullie\PathConverter\NoConverter;
6
7 /**
8 * Converter test case.
9 */
10 class NoConverterTest extends \PHPUnit_Framework_TestCase
11 {
12 /**
13 * Test Converter, provided by dataProvider.
14 *
15 * @test
16 * @dataProvider dataProvider
17 */
18 public function convert($relative, $expected)
19 {
20 $converter = new NoConverter();
21 $result = $converter->convert($relative);
22
23 $this->assertEquals($expected, $result);
24 }
25
26 /**
27 * @return array [relative, from, to, expected result]
28 */
29 public function dataProvider()
30 {
31 $tests = array();
32
33 $tests[] = array(
34 '../images/img.jpg',
35 '../images/img.jpg',
36 );
37
38 $tests[] = array(
39 '../../images/icon.gif',
40 '../../images/icon.gif',
41 );
42
43 // absolute path - doesn't make sense :)
44 $tests[] = array(
45 '/home/username/file.txt',
46 '/home/username/file.txt',
47 );
48
49 $tests[] = array(
50 'image.jpg',
51 'image.jpg',
52 );
53
54 $tests[] = array(
55 '../images/img.jpg',
56 '../images/img.jpg',
57 );
58
59 // https://github.com/forkcms/forkcms/issues/1186
60 $tests[] = array(
61 '../images/img.jpg',
62 '../images/img.jpg',
63 );
64
65 // https://github.com/matthiasmullie/path-converter/issues/1
66 $tests[] = array(
67 'image.jpg',
68 'image.jpg',
69 );
70
71 return $tests;
72 }
73 }
74