Skip to content

Commit c29a34d

Browse files
committed
Test enhanced
1 parent c9d0623 commit c29a34d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/TestMslsOptionsQueryPostType.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,22 @@
1111
*/
1212
class TestMslsOptionsQueryPostType extends MslsUnitTestCase {
1313

14-
function get_test() {
14+
protected function setUp(): void {
15+
parent::setUp();
16+
1517
Functions\expect( 'get_option' )->once()->andReturn( [ 'de_DE' => 42 ] );
1618

17-
return new MslsOptionsQueryPostType();
19+
$this->test = new MslsOptionsQueryPostType();
1820
}
1921

20-
function test_has_value_method() {
21-
$obj = $this->get_test();
22-
23-
$this->assertIsBool( $obj->has_value( 'de_DE' ) );
22+
public function test_has_value(): void {
23+
$this->assertIsBool( $this->test->has_value( 'de_DE' ) );
2424
}
2525

26-
function test_get_current_link_method() {
26+
public function test_get_current_link(): void {
2727
Functions\expect( 'get_post_type_archive_link' )->once()->andReturn( 'https://example.org/queried-posttype' );
2828

29-
$obj = $this->get_test();
30-
31-
$this->assertEquals( 'https://example.org/queried-posttype', $obj->get_current_link() );
29+
$this->assertEquals( 'https://example.org/queried-posttype', $this->test->get_current_link() );
3230
}
3331

3432
}

0 commit comments

Comments
 (0)