fix test `test_get_filter_types` to get class name of filters
This commit is contained in:
parent
76fb3b102b
commit
19a06adb6a
|
@ -7,7 +7,7 @@ namespace Tainacan\Tests;
|
||||||
*/
|
*/
|
||||||
class TAINACAN_REST_Filter_Types_Controller extends TAINACAN_UnitApiTestCase {
|
class TAINACAN_REST_Filter_Types_Controller extends TAINACAN_UnitApiTestCase {
|
||||||
|
|
||||||
public function test_get_filter_types(){
|
public function test_get_filter_types() {
|
||||||
|
|
||||||
$ftype_request = new \WP_REST_Request('GET', $this->namespace . '/filter-types');
|
$ftype_request = new \WP_REST_Request('GET', $this->namespace . '/filter-types');
|
||||||
|
|
||||||
|
@ -17,12 +17,12 @@ class TAINACAN_REST_Filter_Types_Controller extends TAINACAN_UnitApiTestCase {
|
||||||
|
|
||||||
$Tainacan_Filters = \Tainacan\Repositories\Filters::get_instance();
|
$Tainacan_Filters = \Tainacan\Repositories\Filters::get_instance();
|
||||||
|
|
||||||
$filter_types = $Tainacan_Filters->fetch_filter_types('NAME');
|
$filter_types = $Tainacan_Filters->fetch_filter_types( );
|
||||||
|
|
||||||
$this->assertEquals(count($filter_types), count($data));
|
$this->assertEquals(count($filter_types), count($data));
|
||||||
|
|
||||||
foreach ($data as $ftype){
|
foreach ($data as $ftype) {
|
||||||
$this->assertContains($ftype['filter_type'], $filter_types);
|
$this->assertContains($ftype['className'], $filter_types);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue