Skip to content

Commit 38d79f9

Browse files
authored
Merge pull request #58 from Yoast/stories/fix-path-assets-class
fix path and test that has the same bug
2 parents f5207a1 + 496854b commit 38d79f9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

inc/class-yoast-acf-analysis-assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Yoast_ACF_Analysis_Assets {
1313
* Initialize.
1414
*/
1515
public function init() {
16-
$this->plugin_data = get_plugin_data( dirname( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ) );
16+
$this->plugin_data = get_plugin_data( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE );
1717

1818
add_filter( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
1919
}

tests/php/unit/AssetsTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ public function testInitHook() {
1818
define( 'AC_SEO_ACF_ANALYSIS_PLUGIN_FILE', '/directory/file' );
1919
Functions\expect( 'get_plugin_data' )
2020
->once()
21-
->with( dirname( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE ) )
22-
->andReturn( array( 'Version' => '1.0.0' ) );
21+
->with( AC_SEO_ACF_ANALYSIS_PLUGIN_FILE )
22+
->andReturn(
23+
array(
24+
'Version' => '2.0.0',
25+
)
26+
);
2327

2428
$testee = new \Yoast_ACF_Analysis_Assets();
2529
$testee->init();

0 commit comments

Comments
 (0)