Skip to content

Commit

Permalink
Use Jane v8
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil committed Jan 24, 2024
1 parent 40dd4c0 commit caab98f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 33 deletions.
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"homepage": "https://jolicode.com/"
}
],
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Korbeil/jane-v8"
}
],
"require": {
"php": ">=8.0",
"ext-json": "*",
Expand All @@ -22,13 +28,12 @@
"symfony/deprecation-contracts": "^2.4 || ^3.0",
"symfony/property-access": "^5.4 || ^6.0",
"symfony/property-info": "^5.4 || ^6.0",
"symfony/serializer": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0"
"symfony/serializer": "^7.0",
"symfony/yaml": "^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.17.0",
"jane-php/json-schema": "^7.4",
"jane-php/json-schema-runtime": "^7.4",
"jane-php/jane-php": "@dev",
"phpstan/phpstan": "^1.9",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4.17 || ^6.0",
Expand Down
18 changes: 7 additions & 11 deletions tests/Jane/JaneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@

namespace JoliCode\Elastically\Tests\Jane;

use Jane\Component\JsonSchema\Console\Command\GenerateCommand;
use Jane\Component\JsonSchema\Console\Loader\ConfigLoader;
use Jane\Component\JsonSchema\Console\Loader\SchemaLoader;
use Jane\Component\JsonSchemaGenerator\Configuration;
use Jane\Component\JsonSchemaGenerator\Generator;
use JoliCode\Elastically\Client;
use JoliCode\Elastically\IndexBuilder;
use JoliCode\Elastically\Indexer;
Expand All @@ -28,8 +27,6 @@
use JoliCode\Elastically\Tests\Jane\generated\Model\MyModelIngredientsItemAnyOf;
use JoliCode\Elastically\Tests\Jane\generated\Normalizer\JaneObjectNormalizer;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Serializer\Encoder\JsonDecode;
use Symfony\Component\Serializer\Encoder\JsonEncode;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
Expand All @@ -41,12 +38,11 @@ class JaneTest extends TestCase
public function testCreateIndexAndSearchWithJaneObject()
{
// Build the models
$command = new GenerateCommand(new ConfigLoader(), new SchemaLoader());
$inputArray = new ArrayInput([
'--config-file' => __DIR__ . '/jane-config.php',
], $command->getDefinition());

$command->execute($inputArray, new NullOutput());
$generator = new Generator(new Configuration(
outputDirectory: __DIR__ . '/generated/',
baseNamespace: 'JoliCode\\Elastically\\Tests\\Jane\\generated',
));
$generator->fromPath(__DIR__ . '/schema.json', 'MyModel');

// Build the Serializer
$normalizers = [
Expand Down
18 changes: 0 additions & 18 deletions tests/Jane/jane-config.php

This file was deleted.

2 changes: 2 additions & 0 deletions tests/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ public function supportsDenormalization($data, $type, $format = null, array $con
public function serialize(mixed $data, string $format, array $context = []): string {}

public function deserialize(mixed $data, string $type, string $format, array $context = []): mixed {}

public function getSupportedTypes(?string $format): array {}
}

class SearchTestDto
Expand Down

0 comments on commit caab98f

Please sign in to comment.