Skip to content

Commit

Permalink
Set method tested
Browse files Browse the repository at this point in the history
  • Loading branch information
lloc committed Sep 16, 2024
1 parent 8cb6599 commit 0e92515
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/phpunit/TestMslsPostTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ protected function setUp(): void {

$collection = \Mockery::mock( MslsBlogCollection::class );
$collection->shouldReceive( 'get' )->andReturn( $blogs );
$collection->shouldReceive( 'has_current_blog' )->andReturnTrue();
$collection->shouldReceive( 'get_current_blog' )->andReturn( $blogs[0] );

$this->test = new MslsPostTag( $options, $collection );
}
Expand Down Expand Up @@ -163,4 +165,17 @@ public function test_the_input_no_blogs(): void {

$this->assertFalse( $value );
}

public function test_set() {
$taxonomy = \Mockery::mock( MslsTaxonomy::class );
$taxonomy->shouldReceive( 'acl_request' )->once()->andReturn( 'post_tag' );

Functions\expect( 'msls_content_types' )->once()->andReturn( $taxonomy );
Functions\expect( 'delete_option' )->twice();
Functions\expect( 'switch_to_blog' )->twice();
Functions\expect( 'restore_current_blog' )->twice();

$this->expectNotToPerformAssertions();
$this->test->set( 42 );
}
}

0 comments on commit 0e92515

Please sign in to comment.