Skip to content

Commit

Permalink
Fix tests with phpunit 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Apr 2, 2021
1 parent 3c5f654 commit be9be0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/Settings/ConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function test_init_form_fields() {

WP_Mock::userFunction( 'get_post_types' )->with( [ 'public' => true ] )->andReturn( $post_types );

$subject = Mockery::mock( Converter::class )->makePartial();
$subject = Mockery::mock( Converter::class )->makePartial()->shouldAllowMockingProtectedMethods();

$subject->init_form_fields();
self::assertSame( $expected, $this->get_protected_property( $subject, 'form_fields' ) );
Expand Down Expand Up @@ -218,7 +218,7 @@ public function test_settings_page() {
public function test_section_callback( $id, $expected ) {
WP_Mock::passthruFunction( 'wp_kses_post' );

$converter = Mockery::mock( Converter::class )->makePartial();
$converter = Mockery::mock( Converter::class )->makePartial()->shouldAllowMockingProtectedMethods();

ob_start();
$converter->section_callback( [ 'id' => $id ] );
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/Settings/TablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function test_parent_slug() {
* @throws ReflectionException ReflectionException.
*/
public function test_init_locales() {
$subject = Mockery::mock( Tables::class )->makePartial();
$subject = Mockery::mock( Tables::class )->makePartial()->shouldAllowMockingProtectedMethods();

$method = $this->set_method_accessibility( $subject, 'init_locales' );
$method->invoke( $subject );
Expand Down Expand Up @@ -165,7 +165,7 @@ public function test_init_locales() {
* @throws ReflectionException ReflectionException.
*/
public function test_init_form_fields() {
$subject = Mockery::mock( Tables::class )->makePartial();
$subject = Mockery::mock( Tables::class )->makePartial()->shouldAllowMockingProtectedMethods();

FunctionMocker::replace(
'\Cyr_To_Lat\Conversion_Tables::get',
Expand Down Expand Up @@ -254,7 +254,7 @@ public function test_section_callback() {

WP_Mock::userFunction( 'get_locale' )->andReturn( $locale );

$subject = Mockery::mock( Tables::class )->makePartial();
$subject = Mockery::mock( Tables::class )->makePartial()->shouldAllowMockingProtectedMethods();

ob_start();
$subject->section_callback(
Expand Down

0 comments on commit be9be0c

Please sign in to comment.