31 lines
714 B
PHP
31 lines
714 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMultiCity\Tests;
|
|
|
|
use WPMultiCity\ShortcodeDmr;
|
|
|
|
final class ShortcodeDmrTest extends TestCase
|
|
{
|
|
public function test_register_attaches_init_action(): void
|
|
{
|
|
ShortcodeDmr::register();
|
|
|
|
self::assertNotFalse(
|
|
has_action('init', [ShortcodeDmr::class, 'do_register']),
|
|
'ShortcodeDmr::register() must hook init'
|
|
);
|
|
}
|
|
|
|
public function test_do_register_registers_shortcode(): void
|
|
{
|
|
\Brain\Monkey\Functions\expect('add_shortcode')
|
|
->once()
|
|
->with('shortcode_dmr', [ShortcodeDmr::class, 'render']);
|
|
|
|
ShortcodeDmr::do_register();
|
|
|
|
self::assertTrue(true);
|
|
}
|
|
}
|