You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message: '#Property ApiPlatform\\Core\\Test\\DoctrineMongoDbOdmFilterTestCase::\$repository \(Doctrine\\ODM\\MongoDB\\Repository\\DocumentRepository\) does not accept Doctrine\\ORM\\EntityRepository<ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Document\\Dummy>\.#'
if (!$response = self::getHttpClient()->getResponse()) {
124
-
static::fail('A client must have an HTTP Response to make assertions. Did you forget to make an HTTP request?');
152
+
static$schemaFactory;
153
+
154
+
if (null !== $schemaFactory) {
155
+
return$schemaFactory;
125
156
}
126
157
127
-
return$response;
158
+
if (!isset(static::$container) || !static::$containerinstanceof ContainerInterface || !static::$container->has('api_platform.json_schema.schema_factory')) {
159
+
thrownew \LogicException(sprintf('You cannot use the resource JSON Schema assertions because the "%s" service cannot be fetched from the container.', 'api_platform.json_schema.schema_factory'));
@@ -46,15 +51,17 @@ public function toString(): string
46
51
}
47
52
48
53
/**
49
-
* @param array $other
54
+
* @param array|object $other
50
55
*/
51
56
protectedfunctionmatches($other): bool
52
57
{
53
58
if (!class_exists(Validator::class)) {
54
59
thrownew \RuntimeException('The "justinrainbow/json-schema" library must be installed to use "assertMatchesJsonSchema()". Try running "composer require --dev justinrainbow/json-schema".');
->addOption('itemOperation', null, InputOption::VALUE_REQUIRED, 'The item operation')
54
55
->addOption('collectionOperation', null, InputOption::VALUE_REQUIRED, 'The collection operation')
55
56
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The response format', (string) $this->formats[0])
56
-
->addOption('type', null, InputOption::VALUE_REQUIRED, 'The type of schema to generate (input or output)', 'input');
57
+
->addOption('type', null, InputOption::VALUE_REQUIRED, sprintf('The type of schema to generate (%s or %s)', Schema::TYPE_INPUT, Schema::TYPE_OUTPUT), Schema::TYPE_INPUT);
57
58
}
58
59
59
60
/**
@@ -71,11 +72,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
0 commit comments