2017-10-20 14:30:04 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Class TestCollections
|
|
|
|
*
|
|
|
|
* @package Test_Tainacan
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sample test case.
|
|
|
|
*/
|
|
|
|
class TestCollections extends WP_UnitTestCase {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A single example test.
|
|
|
|
*/
|
|
|
|
function test_add() {
|
2017-11-03 20:23:41 +00:00
|
|
|
|
|
|
|
$x = new TainacanCollection();
|
2017-10-20 14:30:04 +00:00
|
|
|
|
2017-11-03 20:23:41 +00:00
|
|
|
$x->set_name('teste');
|
|
|
|
$x->set_description('adasdasdsa');
|
|
|
|
$x->set_itens_per_page(23);
|
|
|
|
|
|
|
|
global $TainacanCollections;
|
|
|
|
$id = $TainacanCollections->insert($x);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
$test = $TainacanCollections->get_collection_by_id($id);
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($test->get_name(), 'teste');
|
|
|
|
$this->assertEquals($test->get_description(), 'adasdasdsa');
|
|
|
|
$this->assertEquals($test->get_itens_per_page(), 23);
|
2017-10-20 14:30:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|