-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathTestMslsLink.php
36 lines (24 loc) · 874 Bytes
/
TestMslsLink.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php declare( strict_types=1 );
namespace lloc\MslsTests;
use Brain\Monkey\Functions;
use lloc\Msls\MslsLink;
class TestMslsLink extends MslsUnitTestCase {
public function test_get_types(): void {
$this->assertCount( 4, MslsLink::get_types() );
}
public function test_get_description(): void {
Functions\when( '__' )->returnArg();
$this->assertEquals( 'Flag and description', MslsLink::get_description() );
}
public function test_get_types_description(): void {
Functions\when( '__' )->returnArg();
$this->assertCount( 4, MslsLink::get_types_description() );
}
public function test_callback(): void {
$this->assertEquals( '{Test}', MslsLink::callback( 'Test' ) );
}
public function test_object2string_conversion(): void {
$obj = MslsLink::create( 0 );
$this->assertEquals( '<img src="{src}" alt="{alt}"/> {txt}', strval( $obj ) );
}
}