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')); }
public function testMandatoryConstraintsAreAutomaticallyAllowed() { $container = new Container(['resources' => ['foo' => ['constraints' => ['mandatory' => ['mandatory_property']]]]]); $this->assertEquals(['mandatory_property'], $container->allowed('foo')); }