-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test SV_WC_Helper::is_wc_navigation_enabled method
- Loading branch information
1 parent
f5c05db
commit 066a4fc
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace SkyVerge\WooCommerce\PluginFramework\v5_14_0\Tests\Unit; | ||
|
||
use ReflectionException; | ||
use SkyVerge\WooCommerce\PluginFramework\v5_15_0\SV_WC_Helper; | ||
use SkyVerge\WooCommerce\PluginFramework\v5_15_0\SV_WC_Plugin_Compatibility; | ||
use SkyVerge\WooCommerce\PluginFramework\v5_15_0\Tests\TestCase; | ||
|
||
class HelperTest extends TestCase | ||
{ | ||
/** | ||
* @covers \SkyVerge\WooCommerce\PluginFramework\v5_15_0\SV_WC_Helper::is_wc_navigation_enabled() | ||
* | ||
* @throws ReflectionException | ||
*/ | ||
public function testCanDetermineIfNavigationFeaturedEnabled() : void | ||
{ | ||
$this->mockStaticMethod(SV_WC_Plugin_Compatibility::class, 'is_wc_version_gte') | ||
->once() | ||
->with('9.3') | ||
->andReturnFalse(); | ||
|
||
$this->mockStaticMethod(SV_WC_Helper::class, 'isEnhancedNavigationFeatureEnabled') | ||
->once() | ||
->andReturnTrue(); | ||
|
||
$this->mockStaticMethod(SV_WC_Helper::class, 'enhancedNavigationDeprecationNotice') | ||
->never(); | ||
|
||
$this->assertTrue(SV_WC_Helper::is_wc_navigation_enabled()); | ||
} | ||
|
||
/** | ||
* @covers \SkyVerge\WooCommerce\PluginFramework\v5_15_0\SV_WC_Helper::is_wc_navigation_enabled() | ||
* | ||
* @throws ReflectionException | ||
*/ | ||
public function testAlwaysDetermineNavigationFeaturedDisabled() : void | ||
{ | ||
$this->mockStaticMethod(SV_WC_Plugin_Compatibility::class, 'is_wc_version_gte') | ||
->once() | ||
->with('9.3') | ||
->andReturnTrue(); | ||
|
||
$this->mockStaticMethod(SV_WC_Helper::class, 'enhancedNavigationDeprecationNotice') | ||
->once(); | ||
|
||
$this->mockStaticMethod(SV_WC_Helper::class, 'isEnhancedNavigationFeatureEnabled') | ||
->never(); | ||
|
||
$this->assertFalse(SV_WC_Helper::is_wc_navigation_enabled()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters