def testRemove(self): """ @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.remove """ bag = ParameterBag({ 'foo': 'foo', 'bar': 'bar', }); bag.remove('foo'); self.assertEqual({'bar': 'bar'}, bag.all(), '->remove() removes a parameter'); bag.remove('BAR'); self.assertEqual({}, bag.all(), '->remove() converts key to lowercase before removing');
def testRemove(self): """ @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.remove """ bag = ParameterBag({ 'foo': 'foo', 'bar': 'bar', }) bag.remove('foo') self.assertEqual({'bar': 'bar'}, bag.all(), '->remove() removes a parameter') bag.remove('BAR') self.assertEqual( {}, bag.all(), '->remove() converts key to lowercase before removing')
def testConstructor(self): """ @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.__construct """ parameters = { 'foo': 'foo', 'bar': 'bar', }; bag = ParameterBag(parameters); self.assertEqual(parameters, bag.all(), '__init__() takes an array of parameters as its first argument');
def testClear(self): """ @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.clear """ parameters = { 'foo': 'foo', 'bar': 'bar', } bag = ParameterBag(parameters) bag.clear() self.assertEqual({}, bag.all(), '->clear() removes all parameters')
def testClear(self): """ @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.clear """ parameters = { 'foo': 'foo', 'bar': 'bar', }; bag = ParameterBag(parameters); bag.clear(); self.assertEqual({}, bag.all(), '->clear() removes all parameters');
def testConstructor(self): """ @covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag.__construct """ parameters = { 'foo': 'foo', 'bar': 'bar', } bag = ParameterBag(parameters) self.assertEqual( parameters, bag.all(), '__init__() takes an array of parameters as its first argument')