File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
tests/Symfony/Tests/Component/DependencyInjection Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -69,4 +69,14 @@ public function testSetArgument()
69
69
$ this ->assertSame ($ def , $ def ->replaceArgument (0 , 'foo ' ));
70
70
$ this ->assertEquals (array ('index_0 ' => 'foo ' ), $ def ->getArguments ());
71
71
}
72
+
73
+ /**
74
+ * @expectedException InvalidArgumentException
75
+ */
76
+ public function testReplaceArgumentShouldRequireIntegerIndex ()
77
+ {
78
+ $ def = new DefinitionDecorator ('foo ' );
79
+
80
+ $ def ->replaceArgument ('0 ' , 'foo ' );
81
+ }
72
82
}
Original file line number Diff line number Diff line change @@ -221,6 +221,28 @@ public function testSetArgument()
221
221
$ this ->assertSame (array ('foo ' , 'bar ' ), $ def ->getArguments ());
222
222
}
223
223
224
+ /**
225
+ * @expectedException OutOfBoundsException
226
+ */
227
+ public function testGetArgumentShouldCheckBounds ()
228
+ {
229
+ $ def = new Definition ('stdClass ' );
230
+
231
+ $ def ->addArgument ('foo ' );
232
+ $ def ->getArgument (1 );
233
+ }
234
+
235
+ /**
236
+ * @expectedException OutOfBoundsException
237
+ */
238
+ public function testReplaceArgumentShouldCheckBounds ()
239
+ {
240
+ $ def = new Definition ('stdClass ' );
241
+
242
+ $ def ->addArgument ('foo ' );
243
+ $ def ->replaceArgument (1 , 'bar ' );
244
+ }
245
+
224
246
public function testSetGetProperties ()
225
247
{
226
248
$ def = new Definition ('stdClass ' );
You can’t perform that action at this time.
0 commit comments