|
12 | 12 | namespace Symfony\Component\ExpressionLanguage\Tests;
|
13 | 13 |
|
14 | 14 | use PHPUnit\Framework\TestCase;
|
| 15 | +use Psr\Cache\CacheItemInterface; |
| 16 | +use Psr\Cache\CacheItemPoolInterface; |
15 | 17 | use Symfony\Component\ExpressionLanguage\ExpressionFunction;
|
16 | 18 | use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
17 | 19 | use Symfony\Component\ExpressionLanguage\ParsedExpression;
|
| 20 | +use Symfony\Component\ExpressionLanguage\SyntaxError; |
18 | 21 | use Symfony\Component\ExpressionLanguage\Tests\Fixtures\TestProvider;
|
19 | 22 |
|
20 | 23 | class ExpressionLanguageTest extends TestCase
|
21 | 24 | {
|
22 | 25 | public function testCachedParse()
|
23 | 26 | {
|
24 |
| - $cacheMock = $this->getMockBuilder(\Psr\Cache\CacheItemPoolInterface::class)->getMock(); |
25 |
| - $cacheItemMock = $this->getMockBuilder(\Psr\Cache\CacheItemInterface::class)->getMock(); |
| 27 | + $cacheMock = $this->createMock(CacheItemPoolInterface::class); |
| 28 | + $cacheItemMock = $this->createMock(CacheItemInterface::class); |
26 | 29 | $savedParsedExpression = null;
|
27 | 30 | $expressionLanguage = new ExpressionLanguage($cacheMock);
|
28 | 31 |
|
@@ -107,7 +110,7 @@ public function testShortCircuitOperatorsCompile($expression, array $names, $exp
|
107 | 110 |
|
108 | 111 | public function testParseThrowsInsteadOfNotice()
|
109 | 112 | {
|
110 |
| - $this->expectException(\Symfony\Component\ExpressionLanguage\SyntaxError::class); |
| 113 | + $this->expectException(SyntaxError::class); |
111 | 114 | $this->expectExceptionMessage('Unexpected end of expression around position 6 for expression `node.`.');
|
112 | 115 | $expressionLanguage = new ExpressionLanguage();
|
113 | 116 | $expressionLanguage->parse('node.', ['node']);
|
@@ -155,8 +158,8 @@ public function testStrictEquality()
|
155 | 158 |
|
156 | 159 | public function testCachingWithDifferentNamesOrder()
|
157 | 160 | {
|
158 |
| - $cacheMock = $this->getMockBuilder(\Psr\Cache\CacheItemPoolInterface::class)->getMock(); |
159 |
| - $cacheItemMock = $this->getMockBuilder(\Psr\Cache\CacheItemInterface::class)->getMock(); |
| 161 | + $cacheMock = $this->createMock(CacheItemPoolInterface::class); |
| 162 | + $cacheItemMock = $this->createMock(CacheItemInterface::class); |
160 | 163 | $expressionLanguage = new ExpressionLanguage($cacheMock);
|
161 | 164 | $savedParsedExpression = null;
|
162 | 165 |
|
|
0 commit comments