CommerceTwigExtensionTest.php in Commerce Core 8.2
File
tests/src/Kernel/CommerceTwigExtensionTest.php
View source
<?php
namespace Drupal\Tests\commerce\Kernel;
use Drupal\commerce_price\Entity\Currency;
class CommerceTwigExtensionTest extends CommerceKernelTestBase {
public static $modules = [
'commerce_test',
];
public function testRenderConfigEntity() {
$theme = [
'#theme' => 'render_entity',
'#entity' => Currency::load('USD'),
];
$this
->expectException('InvalidArgumentException');
$this
->render($theme);
}
public function testRenderContentEntity() {
$account = $this
->createUser();
$theme = [
'#theme' => 'render_entity',
'#entity' => $account,
];
$this
->render($theme);
$this
->assertText('Member for');
}
}