|
@@ 27-35 (lines=9) @@
|
| 24 |
|
return new DataWrapper($data, $safe); |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
public function testCheckFieldDirect() |
| 28 |
|
{ |
| 29 |
|
$wrapper = $this->prepareWrapper(FALSE); |
| 30 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['=','field1', 'value1'])); |
| 31 |
|
$this->assertFalse(CheckHelper::check($wrapper, ['=','field1', 'wrongValue'])); |
| 32 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['=','notExistField', null])); |
| 33 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['=','arrayObj.count()', 2])); |
| 34 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['>','arrayObj.count()', 1])); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function testCheckFieldRelated() |
| 38 |
|
{ |
|
@@ 37-45 (lines=9) @@
|
| 34 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['>','arrayObj.count()', 1])); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function testCheckFieldRelated() |
| 38 |
|
{ |
| 39 |
|
$wrapper = $this->prepareWrapper(FALSE); |
| 40 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['*=','field1', 'array.field1'])); |
| 41 |
|
$this->assertFalse(CheckHelper::check($wrapper, ['*=','field1', 'notExistField'])); |
| 42 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['*=','notExistField', 'notExistField2'])); |
| 43 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['*=','arrayObj.count()', 'arrayObj.count()'])); |
| 44 |
|
$this->assertTrue(CheckHelper::check($wrapper, ['*>=','arrayObj.count()', 'arrayObj.count()'])); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
public function testCheckLogical() |
| 48 |
|
{ |