Skip to content

Commit c9d0623

Browse files
authored
Merge pull request #279 from lloc/chore
Tests enhanced
2 parents 4a6d0e6 + fb14529 commit c9d0623

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/TestMslsOptionsQueryDay.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
class TestMslsOptionsQueryDay extends MslsUnitTestCase {
1313

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

1719
$this->test = new MslsOptionsQueryDay();

tests/TestMslsOptionsQueryMonth.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,22 @@
88

99
class TestMslsOptionsQueryMonth extends MslsUnitTestCase {
1010

11-
function get_test() {
11+
public function setUp(): void {
12+
parent::setUp();
13+
1214
Functions\expect( 'get_option' )->once()->andReturn( [ 'de_DE' => 42 ] );
1315

14-
return new MslsOptionsQueryMonth();
16+
$this->test = new MslsOptionsQueryMonth();
1517
}
1618

17-
function test_has_value_method() {
18-
$obj = $this->get_test();
19-
20-
$this->assertIsBool( $obj->has_value( 'de_DE' ) );
19+
public function test_has_value(): void {
20+
$this->assertIsBool( $this->test->has_value( 'de_DE' ) );
2121
}
2222

23-
function test_get_current_link_method() {
23+
public function test_get_current_link(): void {
2424
Functions\expect( 'get_month_link' )->once()->andReturn( 'https://example.org/queried-month' );
2525

26-
$obj = $this->get_test();
27-
28-
$this->assertEquals( 'https://example.org/queried-month', $obj->get_current_link() );
26+
$this->assertEquals( 'https://example.org/queried-month', $this->test->get_current_link() );
2927
}
3028

3129
}

0 commit comments

Comments
 (0)