mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Refactoring
This commit is contained in:
parent
7d2031da03
commit
02b7bb4af9
4 changed files with 159 additions and 71 deletions
29
tests/PHPUnit/StatusReport/RendererTest.php
Normal file
29
tests/PHPUnit/StatusReport/RendererTest.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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' => 'Foo',
|
||||
'value' => 'Bar'
|
||||
],
|
||||
];
|
||||
|
||||
when('esc_attr')->returnArg();
|
||||
|
||||
$testee = new Renderer();
|
||||
$result = $testee->render('Some title here', $items);
|
||||
|
||||
self::assertStringContainsString('<h2>Some title here</h2>', $result);
|
||||
self::assertStringContainsString('<td data-export-label="Foo">Foo</td>', $result);
|
||||
self::assertStringContainsString('<td>Bar</td>', $result);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue