@@ 40-55 (lines=16) @@ | ||
37 | ); |
|
38 | } |
|
39 | ||
40 | public function testResourcesAreResourcesChild() |
|
41 | { |
|
42 | $container = new Container([ |
|
43 | 'resources' => [ |
|
44 | 'foo' => [], |
|
45 | 'bar' => [ |
|
46 | 'constraints' => [], |
|
47 | ], |
|
48 | ], |
|
49 | ]); |
|
50 | ||
51 | $this->assertSame( |
|
52 | 2, |
|
53 | $container->countResources() |
|
54 | ); |
|
55 | } |
|
56 | ||
57 | /** |
|
58 | * @expectedException \Sensorario\Resources\Exceptions\InvalidConstraintException |
|
@@ 78-94 (lines=17) @@ | ||
75 | * @expectedException \Sensorario\Resources\Exceptions\NotAllowedConstraintException |
|
76 | * @expectedExceptionMessageRegExp /Not allowed `foo` constraint/ |
|
77 | */ |
|
78 | public function testCannotCreateResourceWithoutAllowedConstraints() |
|
79 | { |
|
80 | $container = new Container([ |
|
81 | 'resources' => [ |
|
82 | 'foo' => [ |
|
83 | 'constraints' => [ |
|
84 | ], |
|
85 | ], |
|
86 | ], |
|
87 | ]); |
|
88 | ||
89 | $container->create( |
|
90 | 'foo', [ |
|
91 | 'foo' => 'bar', |
|
92 | ] |
|
93 | ); |
|
94 | } |
|
95 | ||
96 | public function testCon() |
|
97 | { |