PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.3.48
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.3.48
1.4.18 1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 All 181 releases
disco / vendor / micropackage / requirements / tests / Abstracts / test-checker.php

test-checker.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.3.48, at vendor/micropackage/requirements/tests/Abstracts/test-checker.php

58 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class TestChecker
4 *
5 * @package micropackage/requirements
6 */
7
8 namespace Micropackage\Requirements\Test\Abstracts;
9
10 use Micropackage\Requirements\Requirements;
11 use Micropackage\Requirements\Abstracts\Checker;
12
13 /**
14 * Abstract checker test case.
15 */
16 class TestChecker extends \WP_UnitTestCase {
17
18 public function setUp() {
19
20 parent::setUp();
21
22 $this->checker = $this->getMockBuilder( 'Micropackage\\Requirements\\Abstracts\\Checker' )
23 ->getMockForAbstractClass();
24
25 $this->checker->name = 'test';
26
27 }
28
29 public function test_add_error_should_add_one_error() {
30
31 $this->checker->add_error( 'test' );
32
33 $this->assertSame( [ 'test' ], $this->checker->get_errors() );
34
35 }
36
37 public function test_add_error_should_add_two_errors() {
38
39 $errors = [
40 'test',
41 uniqid(),
42 ];
43
44 $this->checker->add_error( $errors[0] );
45 $this->checker->add_error( $errors[1] );
46
47 $this->assertSame( $errors, $this->checker->get_errors() );
48
49 }
50
51 public function test_get_errors_should_get_empty_array_if_no_error_set() {
52
53 $this->assertSame( [], $this->checker->get_errors() );
54
55 }
56
57 }
58