'api.example.com']); } public function testConstraintGroupsAreRespectedWhenDescribingModels() { $expected = [ 'required' => [ 'property', ], 'properties' => [ 'property' => [ 'type' => 'integer', // the min/max constraint is in the default group only and shouldn't // be read here with validation groups turned on ], ], 'type' => 'object', 'schema' => 'SymfonyConstraintsTestGroup', ]; $this->assertEquals( $expected, json_decode($this->getModel('SymfonyConstraintsTestGroup')->toJson(), true) ); } public function testConstraintDefaultGroupsAreRespectedWhenReadingAnnotations() { $expected = [ 'properties' => [ 'property' => [ 'type' => 'integer', // min/max will be read here as they are in th e default group 'maximum' => 100, 'minimum' => 1, ], 'propertyInDefaultGroup' => [ 'type' => 'integer', // min/max will be read here as they are in th e default group 'maximum' => 100, 'minimum' => 1, ], ], 'type' => 'object', 'schema' => 'SymfonyConstraintsDefaultGroup', ]; $this->assertEquals( $expected, json_decode($this->getModel('SymfonyConstraintsDefaultGroup')->toJson(), true) ); } }