Skip to content

Commit 89dabb5

Browse files
committed
Tests added
1 parent 3e62dca commit 89dabb5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/TestMslsOptionsQueryAuthor.php

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,20 @@
88

99
class TestMslsOptionsQueryAuthor extends MslsUnitTestCase {
1010

11-
function get_test() {
11+
protected function setUp(): void {
1212
Functions\expect( 'get_option' )->once()->andReturn( [ 'de_DE' => 42 ] );
1313

14-
return new MslsOptionsQueryAuthor();
14+
$this->test = new MslsOptionsQueryAuthor();
1515
}
1616

1717
function test_has_value_method() {
18-
$obj = $this->get_test();
19-
20-
$this->assertIsBool( $obj->has_value( 'de_DE' ) );
18+
$this->assertIsBool( $this->test->has_value( 'de_DE' ) );
2119
}
2220

2321
function test_get_current_link_method() {
2422
Functions\expect( 'get_author_posts_url' )->once()->andReturn( 'https://example.org/queried-author' );
2523

26-
$obj = $this->get_test();
27-
28-
$this->assertEquals( 'https://example.org/queried-author', $obj->get_current_link() );
24+
$this->assertEquals( 'https://example.org/queried-author', $this->test->get_current_link() );
2925
}
3026

3127
}

0 commit comments

Comments
 (0)