| @@ 40-49 (lines=10) @@ | ||
| 37 | /** |
|
| 38 | * Tests whether enqueueing adds the latest class version to the global array. |
|
| 39 | */ |
|
| 40 | public function test_enqueueing_adds_the_latest_version_to_the_global_array() { |
|
| 41 | enqueue_package_class( 'className', '1', 'path_to_class' ); |
|
| 42 | enqueue_package_class( 'className', '2', 'path_to_class_v2' ); |
|
| 43 | ||
| 44 | global $jetpack_packages_classmap; |
|
| 45 | $this->assertTrue( isset( $jetpack_packages_classmap['className'] ) ); |
|
| 46 | $this->assertEquals( $jetpack_packages_classmap['className']['version'], '2' ); |
|
| 47 | $this->assertEquals( $jetpack_packages_classmap['className']['path'], 'path_to_class_v2' ); |
|
| 48 | ||
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * Tests whether enqueueing prioritizes the dev version of the class. |
|
| @@ 30-38 (lines=9) @@ | ||
| 27 | /** |
|
| 28 | * Tests whether enqueueing adds the latest file version to the global array. |
|
| 29 | */ |
|
| 30 | public function test_enqueueing_adds_the_latest_version_to_the_global_array() { |
|
| 31 | enqueue_package_file( 'file_id', '1', 'path_to_file' ); |
|
| 32 | enqueue_package_file( 'file_id', '2', 'path_to_file_v2' ); |
|
| 33 | ||
| 34 | global $jetpack_packages_filemap; |
|
| 35 | $this->assertTrue( isset( $jetpack_packages_filemap['file_id'] ) ); |
|
| 36 | $this->assertEquals( $jetpack_packages_filemap['file_id']['version'], '2' ); |
|
| 37 | $this->assertEquals( $jetpack_packages_filemap['file_id']['path'], 'path_to_file_v2' ); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Tests whether enqueueing prioritizes the dev version of the file. |
|