mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
add test
This commit is contained in:
parent
1c96726a72
commit
c7fdfe1bce
1 changed files with 26 additions and 0 deletions
26
tests/PHPUnit/WcGateway/Assets/SettingsPagesAssetsTest.php
Normal file
26
tests/PHPUnit/WcGateway/Assets/SettingsPagesAssetsTest.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\WcGateway\Assets;
|
||||
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
|
||||
class SettingsPagesAssetsTest extends TestCase
|
||||
{
|
||||
public function testRegisterAssets()
|
||||
{
|
||||
$moduleUrl = 'http://example.com/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway';
|
||||
$modulePath = '/var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway';
|
||||
|
||||
$testee = new SettingsPageAssets($moduleUrl, $modulePath);
|
||||
|
||||
when('is_admin')
|
||||
->justReturn(true);
|
||||
when('is_ajax')
|
||||
->justReturn(false);
|
||||
|
||||
$testee->register_assets();
|
||||
|
||||
self::assertSame(has_action('admin_enqueue_scripts', "function()"), 10);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue