mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
35 lines
1 KiB
PHP
35 lines
1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace WooCommerce\PayPalCommerce\StatusReport;
|
|
|
|
use WooCommerce\PayPalCommerce\TestCase;
|
|
use function Brain\Monkey\Functions\when;
|
|
|
|
class RendererTest extends TestCase
|
|
{
|
|
public function testRender()
|
|
{
|
|
$items = [
|
|
[
|
|
'label' => 'Translated Foo',
|
|
'exported_label' => 'Foo',
|
|
'description' => 'Bar',
|
|
'value' => 'Baz'
|
|
],
|
|
];
|
|
|
|
when('esc_attr')->returnArg();
|
|
when('wp_kses_post')->returnArg();
|
|
when('wc_help_tip')->returnArg();
|
|
|
|
$testee = new Renderer();
|
|
$result = $testee->render('Some title here', $items);
|
|
|
|
self::assertStringContainsString('<h2>Some title here</h2>', $result);
|
|
self::assertStringContainsString('data-export-label="Foo"', $result);
|
|
self::assertStringContainsString('Translated Foo', $result);
|
|
self::assertStringContainsString('<td class="help">Bar</td>', $result);
|
|
self::assertStringContainsString('<td>Baz</td>', $result);
|
|
}
|
|
}
|