Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  [PropertyInfo] Update DoctrineExtractor for new DBAL 4 BIGINT type
  Update security.nl.xlf
  [Validator] IBAN Check digits should always between 2 and 98
  [Security] Populate translations for trans-unit 20
  add missing plural translation messages
  filter out empty HTTP header parts
  [String] Fix folded in compat mode
  Remove calls to `getMockForAbstractClass()`
  [ErrorHandler] Do not call xdebug_get_function_stack() with xdebug >= 3.0 when not in develop mode
  [Serializer] Fix type for missing property
  add test for JSON response with null as content
  [Filesystem] Fix dumpFile `stat failed` error hitting custom handler
  Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder`
  [PhpUnitBridge] Fix `DeprecationErrorHandler` with PhpUnit 10
  • Loading branch information
fabpot committed May 17, 2024
2 parents 8a9af46 + 22f15a6 commit 29a9f63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Tests/Loader/ObjectLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ public function testExceptionOnBadMethod()
public function testExceptionOnMethodNotReturningCollection()
{
$this->expectException(\LogicException::class);
$service = $this->getMockBuilder(\stdClass::class)
->addMethods(['loadRoutes'])
->getMock();

$service = $this->createMock(CustomRouteLoader::class);
$service->expects($this->once())
->method('loadRoutes')
->willReturn('NOT_A_COLLECTION');
Expand All @@ -109,6 +108,11 @@ protected function getObject(string $id): object
}
}

interface CustomRouteLoader
{
public function loadRoutes();
}

class TestObjectLoaderRouteService
{
private RouteCollection $collection;
Expand Down
5 changes: 4 additions & 1 deletion Tests/Matcher/RedirectableUrlMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ public function testTrailingRequirementWithDefaultA()

protected function getUrlMatcher(RouteCollection $routes, ?RequestContext $context = null)
{
return $this->getMockForAbstractClass(RedirectableUrlMatcher::class, [$routes, $context ?? new RequestContext()]);
return $this->getMockBuilder(RedirectableUrlMatcher::class)
->setConstructorArgs([$routes, $context ?? new RequestContext()])
->onlyMethods(['redirect'])
->getMock();
}
}

0 comments on commit 29a9f63

Please sign in to comment.