-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
87 additions
and
87 deletions.
There are no files selected for viewing
55 changes: 0 additions & 55 deletions
55
src/Component/spec/Symfony/ExpressionLanguage/ArgumentParserSpec.php
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
src/Component/tests/Integration/Symfony/ExpressionLanguage/ArgumentParserTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Sylius Sp. z o.o. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Component\Resource\tests\Symfony\ExpressionLanguage; | ||
|
||
use Sylius\Resource\Symfony\ExpressionLanguage\ArgumentParserInterface; | ||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||
|
||
final class ArgumentParserTest extends KernelTestCase | ||
{ | ||
public function testResourceFactoryArgumentParser(): void | ||
{ | ||
self::bootKernel(); | ||
|
||
$container = static::getContainer(); | ||
|
||
/** @var ArgumentParserInterface $argumentParser */ | ||
$argumentParser = $container->get('sylius.expression_language.argument_parser.factory'); | ||
|
||
$this->assertInstanceOf(ArgumentParserInterface::class, $argumentParser); | ||
$this->assertTrue($argumentParser->parseExpression('token.getUser() === null')); | ||
$this->assertTrue($argumentParser->parseExpression('user === null')); | ||
$this->assertTrue($argumentParser->parseExpression('request === null')); | ||
} | ||
|
||
public function testRepositoryArgumentParser(): void | ||
{ | ||
self::bootKernel(); | ||
|
||
$container = static::getContainer(); | ||
|
||
/** @var ArgumentParserInterface $argumentParser */ | ||
$argumentParser = $container->get('sylius.expression_language.argument_parser.repository'); | ||
|
||
$this->assertInstanceOf(ArgumentParserInterface::class, $argumentParser); | ||
$this->assertTrue($argumentParser->parseExpression('token.getUser() === null')); | ||
$this->assertTrue($argumentParser->parseExpression('user === null')); | ||
$this->assertTrue($argumentParser->parseExpression('request === null')); | ||
} | ||
|
||
public function testRoutingArgumentParser(): void | ||
{ | ||
self::bootKernel(); | ||
|
||
$container = static::getContainer(); | ||
|
||
/** @var ArgumentParserInterface $argumentParser */ | ||
$argumentParser = $container->get('sylius.expression_language.argument_parser.routing'); | ||
$this->assertTrue($argumentParser->parseExpression('request === null')); | ||
|
||
$this->assertInstanceOf(ArgumentParserInterface::class, $argumentParser); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.