@@ 35-52 (lines=18) @@ | ||
32 | /** |
|
33 | * @expectedException \ScayTrase\Api\Cruds\Exception\NestedConfiguratorException |
|
34 | */ |
|
35 | public function testExceptionThrownOnUnknownNesting() |
|
36 | { |
|
37 | $criteria = [ |
|
38 | 'criteria1' => 'data1', |
|
39 | ]; |
|
40 | ||
41 | $fqcn = \stdClass::class; |
|
42 | $crit = Criteria::create(); |
|
43 | $filters = []; |
|
44 | foreach ($criteria as $key => $value) { |
|
45 | $filters[$key] = $this->createConfigurator($fqcn, $crit, $value, true); |
|
46 | } |
|
47 | ||
48 | $criteria['criteria2'] = 'data2'; |
|
49 | ||
50 | $nested = new NestedCriteriaConfigurator($filters); |
|
51 | $nested->configure($fqcn, $crit, $criteria); |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @expectedException \ScayTrase\Api\Cruds\Exception\NestedConfiguratorException |
|
@@ 57-74 (lines=18) @@ | ||
54 | /** |
|
55 | * @expectedException \ScayTrase\Api\Cruds\Exception\NestedConfiguratorException |
|
56 | */ |
|
57 | public function testExceptionThrownInvalidDataSupplied() |
|
58 | { |
|
59 | $criteria = [ |
|
60 | 'criteria1' => 'data1', |
|
61 | ]; |
|
62 | ||
63 | $fqcn = \stdClass::class; |
|
64 | $crit = Criteria::create(); |
|
65 | $filters = []; |
|
66 | foreach ($criteria as $key => $value) { |
|
67 | $filters[$key] = $this->createConfigurator($fqcn, $crit, $value, true); |
|
68 | } |
|
69 | ||
70 | $criteria = 'data2'; |
|
71 | ||
72 | $nested = new NestedCriteriaConfigurator($filters); |
|
73 | $nested->configure($fqcn, $crit, $criteria); |
|
74 | } |
|
75 | ||
76 | /** |
|
77 | * |