@@ 57-73 (lines=17) @@ | ||
54 | /** |
|
55 | * Tests that `find_class_file` returns the path to the class when present in the classmap. |
|
56 | */ |
|
57 | public function test_find_class_file_returns_path_for_classmap() { |
|
58 | $version_loader = new Version_Loader( |
|
59 | new Version_Selector(), |
|
60 | array( |
|
61 | SharedTestClass::class => array( |
|
62 | 'version' => '1.0.0.0', |
|
63 | 'path' => TEST_PLUGIN_DIR . '/src/SharedTestClass.php', |
|
64 | ), |
|
65 | ), |
|
66 | null, |
|
67 | null |
|
68 | ); |
|
69 | ||
70 | $file_path = $version_loader->find_class_file( SharedTestClass::class ); |
|
71 | ||
72 | $this->assertEquals( TEST_PLUGIN_DIR . '/src/SharedTestClass.php', $file_path ); |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * Test that `find_class_file` returns the path to the class when present in the PSR-4 map. |
|
@@ 78-94 (lines=17) @@ | ||
75 | /** |
|
76 | * Test that `find_class_file` returns the path to the class when present in the PSR-4 map. |
|
77 | */ |
|
78 | public function test_find_class_file_returns_path_for_psr4() { |
|
79 | $version_loader = new Version_Loader( |
|
80 | new Version_Selector(), |
|
81 | null, |
|
82 | array( |
|
83 | Test_Plugin_Factory::TESTING_NAMESPACE => array( |
|
84 | 'version' => '1.0.0.0', |
|
85 | 'path' => array( TEST_PLUGIN_DIR . '/src' ), |
|
86 | ), |
|
87 | ), |
|
88 | null |
|
89 | ); |
|
90 | ||
91 | $file_path = $version_loader->find_class_file( SharedTestClass::class ); |
|
92 | ||
93 | $this->assertEquals( TEST_PLUGIN_DIR . '/src/SharedTestClass.php', $file_path ); |
|
94 | } |
|
95 | ||
96 | /** |
|
97 | * Tests that `find_class_file` returns the path to the class when presented |