public function testGetPages()
{
$params = array('title' => 'My test page is here', 'content_type' => 'page', 'is_active' => 1);
//saving
$new_page_id = save_content($params);
$get_pages = get_pages($params);
$page_found = false;
if (is_array($get_pages)) {
foreach ($get_pages as $page) {
if ($page['id'] == $new_page_id) {
$page_found = true;
$this->assertEquals('page', $page['content_type']);
}
//PHPUnit
$this->assertEquals(true, intval($page['id']) > 0);
}
}
//clean
$delete_sub_page = delete_content($new_page_id);
//PHPUnit
$this->assertEquals(true, $page_found);
$this->assertEquals(true, intval($new_page_id) > 0);
$this->assertEquals(true, is_array($get_pages));
$this->assertEquals(true, is_array($delete_sub_page));
}