woocommerce-paypal-payments/tests/PHPUnit/WcGateway/Assets/SettingsPagesAssetsTest.php

30 lines
842 B
PHP
Raw Normal View History

2021-03-25 15:10:53 +02:00
<?php
namespace WooCommerce\PayPalCommerce\WcGateway\Assets;
2021-06-04 11:57:25 +02:00
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
2021-03-25 15:10:53 +02:00
use WooCommerce\PayPalCommerce\TestCase;
use function Brain\Monkey\Functions\when;
2021-06-04 11:57:25 +02:00
use Mockery;
2021-03-25 15:10:53 +02:00
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';
2021-06-04 11:57:25 +02:00
$bearer = Mockery::mock(Bearer::class);
2021-03-25 15:10:53 +02:00
2021-06-04 11:57:25 +02:00
$testee = new SettingsPageAssets($moduleUrl, $modulePath, $bearer);
2021-03-25 15:10:53 +02:00
when('is_admin')
->justReturn(true);
when('is_ajax')
->justReturn(false);
$testee->register_assets();
self::assertSame(has_action('admin_enqueue_scripts', "function()"), 10);
}
2021-03-25 17:08:55 +02:00
}