Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 4ae39e5

Browse files
committed
Fixed tests
1 parent de367d0 commit 4ae39e5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Tests/Unit/Adapter/PhpcrOdmAdapterTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function setUp()
2929
$this->baseNode = new \stdClass;
3030
$this->parentRoute = new \stdClass;
3131
$this->route = $this->prophesize('Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface');
32+
$this->uriContext = $this->prophesize('Symfony\Cmf\Component\RoutingAuto\UriContext');
3233

3334
$this->phpcrSession = $this->prophesize('PHPCR\SessionInterface');
3435
$this->phpcrRootNode = $this->prophesize('PHPCR\NodeInterface');
@@ -114,7 +115,9 @@ public function testCreateAutoRoute($path, $expectedParentPath, $expectedName, $
114115
->willReturn(null);
115116
}
116117

117-
$res = $this->adapter->createAutoRoute($path, $this->contentDocument, 'fr');
118+
$this->uriContext->getUri()->willReturn($path);
119+
120+
$res = $this->adapter->createAutoRoute($this->uriContext->reveal(), $this->contentDocument, 'fr');
118121
$this->assertNotNull($res);
119122
$this->assertInstanceOf('Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute', $res);
120123
$this->assertEquals($expectedName, $res->getName());
@@ -131,7 +134,8 @@ public function testCreateAutoRouteNonExistingBasePath()
131134
{
132135
$this->dm->getPhpcrSession()->willReturn($this->phpcrSession);
133136
$this->dm->find(null, $this->baseRoutePath)->willReturn(null);
134-
$this->adapter->createAutoRoute('/foo', $this->contentDocument, 'fr');
137+
$this->uriContext->getUri()->willReturn('/asdasd');
138+
$this->adapter->createAutoRoute($this->uriContext->reveal(), $this->contentDocument, 'fr');
135139
}
136140

137141

@@ -176,7 +180,7 @@ public function testFindRouteForUri()
176180

177181
$this->dm->find(null, $this->baseRoutePath . $uri)->willReturn($expectedRoutes);
178182

179-
$res = $this->adapter->findRouteForUri($uri);
183+
$res = $this->adapter->findRouteForUri($uri, $this->uriContext->reveal());
180184
$this->assertSame($expectedRoutes, $res);
181185
}
182186
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"minimum-stability": "dev",
1313
"require": {
14-
"symfony-cmf/routing-auto": "dev-sulu_changes",
14+
"symfony-cmf/routing-auto": "~1.0",
1515
"symfony-cmf/routing-bundle": "~1.2",
1616
"symfony-cmf/core-bundle": "~1.2",
1717
"aferrandini/urlizer": "1.0.*",

0 commit comments

Comments
 (0)