@@ 36-54 (lines=19) @@ | ||
33 | /** |
|
34 | * Tests that the classmap manifest from a single plugin can be handled correctly. |
|
35 | */ |
|
36 | public function test_classmap() { |
|
37 | $path_map = array(); |
|
38 | $this->manifest_handler->read_manifests( |
|
39 | array( TEST_DATA_PATH . '/plugins/dummy_current' ), |
|
40 | 'vendor/composer/jetpack_autoload_classmap.php', |
|
41 | $path_map |
|
42 | ); |
|
43 | ||
44 | $loader = new Version_Loader( |
|
45 | new Version_Selector(), |
|
46 | $path_map, |
|
47 | null, |
|
48 | null |
|
49 | ); |
|
50 | ||
51 | $file = $loader->find_class_file( Test::class ); |
|
52 | ||
53 | $this->assertEquals( TEST_DATA_PATH . '/plugins/dummy_current/includes/class-test.php', $file ); |
|
54 | } |
|
55 | ||
56 | /** |
|
57 | * Tests that the PSR-4 manifest from a single plugin can be handled correctly. |
|
@@ 59-77 (lines=19) @@ | ||
56 | /** |
|
57 | * Tests that the PSR-4 manifest from a single plugin can be handled correctly. |
|
58 | */ |
|
59 | public function test_psr4() { |
|
60 | $path_map = array(); |
|
61 | $this->manifest_handler->read_manifests( |
|
62 | array( TEST_DATA_PATH . '/plugins/dummy_current' ), |
|
63 | 'vendor/composer/jetpack_autoload_psr4.php', |
|
64 | $path_map |
|
65 | ); |
|
66 | ||
67 | $loader = new Version_Loader( |
|
68 | new Version_Selector(), |
|
69 | null, |
|
70 | $path_map, |
|
71 | null |
|
72 | ); |
|
73 | ||
74 | $file = $loader->find_class_file( Psr4Test::class ); |
|
75 | ||
76 | $this->assertEquals( TEST_DATA_PATH . '/plugins/dummy_current/src/Psr4/Test.php', $file ); |
|
77 | } |
|
78 | ||
79 | /** |
|
80 | * Tests that the filemap manifest from a single plugin can be handled correctly. |