Skip to content

Commit

Permalink
Merge pull request #43 from Upstatement/admin-tests
Browse files Browse the repository at this point in the history
Admin tests
  • Loading branch information
lggorman committed Jan 4, 2016
2 parents db2d8cb + 3cfbdc7 commit 06357c7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test-stream-manager-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,30 @@ function testSaveStream() {
$this->assertEquals(5, count($stream->options['stream']));
}

// function testManagerManagerGetInstance() {
// $manager = StreamManagerManager::get_instance();
// $this->assertObjectHasAttribute('plugin', $manager);
// }

// function testStreamManagerInit() {
// $manager = StreamManager::get_instance();
// $this->assertObjectHasAttribute('streams', $manager);
// }

function testAddHelpText() {
set_current_screen( 'sm_stream' );
$admin = StreamManagerAdmin::get_instance();
$admin->add_help_text();
$screen = get_current_screen();
$tabs = $screen->get_help_tabs();
$this->assertEquals(3, count($tabs));
}

function testDefinePostTypes() {
$manager = StreamManager::get_instance();
$manager->define_post_types();
$post_types = get_post_types();
$this->assertTrue(in_array($manager->get_post_type_slug(), $post_types));
}

}

0 comments on commit 06357c7

Please sign in to comment.