Exemplo n.º 1
0
 public function testRewriteRules()
 {
     $container = new Container(['resources' => ['foo' => ['rewrite' => ['foo' => ['set' => ['equals_to' => 'bar'], 'when' => ['greater_than' => 'bar']]], 'constraints' => ['allowed' => ['foo', 'bar']]]]]);
     $this->assertEquals(['foo' => ['set' => ['equals_to' => 'bar'], 'when' => ['greater_than' => 'bar']]], $container->rewrites('foo'));
 }
Exemplo n.º 2
0
 public function testMandatoryConstraintsAreAutomaticallyAllowed()
 {
     $container = new Container(['resources' => ['foo' => ['constraints' => ['mandatory' => ['mandatory_property']]]]]);
     $this->assertEquals(['mandatory_property'], $container->allowed('foo'));
 }