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

Commit 863d6df

Browse files
committed
Added test for non-existant base path
1 parent ce6c9ec commit 863d6df

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Adapter/PhpcrOdmAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function createAutoRoute($uri, $contentDocument, $autoRouteTag)
119119
$path = $this->baseRoutePath;
120120
$document = $parentDocument = $this->dm->find(null, $path);
121121
if (null === $parentDocument) {
122-
throw new \RuntimeException(sprintf('The "route_basepath" configuration points to a non existant path "%s".',
122+
throw new \RuntimeException(sprintf('The "route_basepath" configuration points to a non-existant path "%s".',
123123
$path
124124
));
125125
}

Tests/Unit/Adapter/PhpcrOdmAdapterTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@ public function testCreateAutoRoute($path, $expectedParentPath, $expectedName, $
126126
$this->assertSame($this->contentDocument, $res->getContent());
127127
}
128128

129+
/**
130+
* @expectedException \RuntimeException
131+
* @expectedExceptionMessage configuration points to a non-existant path
132+
*/
133+
public function testCreateAutoRouteNonExistingBasePath()
134+
{
135+
$this->dm->getPhpcrSession()->willReturn($this->phpcrSession);
136+
$this->dm->find(null, $this->baseRoutePath)->willReturn(null);
137+
$this->adapter->createAutoRoute('/foo', $this->contentDocument, 'fr');
138+
}
139+
140+
129141
public function testGetRealClassName()
130142
{
131143
$res = $this->adapter->getRealClassName('Class/Foo');

0 commit comments

Comments
 (0)