assertStringContainsString( 'name="orderable_service"', $output, 'The name of the field should be `orderable_service`' ); $this->assertStringContainsString( 'value=""', $output, 'An empty value attribute is required to show all services' ); $this->assertStringContainsString( 'All services', $output, '`All services` label is required' ); $this->assertStringContainsString( 'value="delivery"', $output, 'It should exist an option with value attribute set to `delivery`' ); $this->assertStringContainsString( 'Delivery', $output, 'It should exist an option with label set to `Delivery`' ); $this->assertStringContainsString( 'value="pickup"', $output, 'It should exist an option with value attribute set to `pickup`' ); $this->assertStringContainsString( 'Pickup', $output, 'It should exist an option with label set to `Pickup`' ); add_filter( 'orderable_services_filter_options', function( $options ) { $options[] = 'table'; return $options; } ); ob_start(); \Orderable_Services_Order::services_filter(); $output = ob_get_clean(); $this->assertStringContainsString( 'value="table"', $output, 'It should exist an option with a custom value added via `orderable_services_filter_options` filter' ); } }