Skip to content

Commit 1b93bfb

Browse files
committed
Fixed failing tests
1 parent 0bab0b8 commit 1b93bfb

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/Handler/BindingCommandHandler.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function handleUpdate(Args $args)
158158

159159
if (!$bindingToUpdate->getContainingPackage() instanceof RootPackage) {
160160
throw new RuntimeException(sprintf(
161-
'Can only update bindings in package "%s".',
161+
'Can only update bindings in the package "%s".',
162162
$this->packages->getRootPackageName()
163163
));
164164
}
@@ -235,7 +235,10 @@ public function handleEnable(Args $args)
235235
$bindingToEnable = $this->getBindingByUuidPrefix($args->getArgument('uuid'));
236236

237237
if ($bindingToEnable->getContainingPackage() instanceof RootPackage) {
238-
throw new RuntimeException('Cannot enable bindings in the root package.');
238+
throw new RuntimeException(sprintf(
239+
'Cannot enable bindings in the package "%s".',
240+
$bindingToEnable->getContainingPackage()->getName()
241+
));
239242
}
240243

241244
$this->discoveryManager->enableBinding($bindingToEnable->getUuid());
@@ -255,7 +258,10 @@ public function handleDisable(Args $args)
255258
$bindingToDisable = $this->getBindingByUuidPrefix($args->getArgument('uuid'));
256259

257260
if ($bindingToDisable->getContainingPackage() instanceof RootPackage) {
258-
throw new RuntimeException('Cannot disable bindings in the root package.');
261+
throw new RuntimeException(sprintf(
262+
'Cannot disable bindings in the package "%s".',
263+
$bindingToDisable->getContainingPackage()->getName()
264+
));
259265
}
260266

261267
$this->discoveryManager->disableBinding($bindingToDisable->getUuid());

tests/Handler/BindingCommandHandlerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ public function testUpdateBindingFailsIfNoUpdateProvided()
988988

989989
/**
990990
* @expectedException \RuntimeException
991-
* @expectedExceptionMessage Can only update bindings in the root package.
991+
* @expectedExceptionMessage Can only update bindings in the package "vendor/root".
992992
*/
993993
public function testUpdateBindingFailsIfNoRootBinding()
994994
{
@@ -1080,7 +1080,7 @@ public function testRemoveBindingFailsIfNotFound()
10801080

10811081
/**
10821082
* @expectedException \RuntimeException
1083-
* @expectedExceptionMessage Can only delete bindings from the root package
1083+
* @expectedExceptionMessage Can only delete bindings from the package "vendor/root".
10841084
*/
10851085
public function testRemoveBindingFailsIfNoRootBinding()
10861086
{
@@ -1144,7 +1144,7 @@ public function testEnableBindingFailsIfNotFound()
11441144

11451145
/**
11461146
* @expectedException \RuntimeException
1147-
* @expectedExceptionMessage Cannot enable bindings in the root package.
1147+
* @expectedExceptionMessage Cannot enable bindings in the package "vendor/root".
11481148
*/
11491149
public function testEnableBindingFailsIfRoot()
11501150
{
@@ -1206,7 +1206,7 @@ public function testDisableBindingsFailsIfNotFound()
12061206

12071207
/**
12081208
* @expectedException \RuntimeException
1209-
* @expectedExceptionMessage Cannot disable bindings in the root package.
1209+
* @expectedExceptionMessage Cannot disable bindings in the package "vendor/root".
12101210
*/
12111211
public function testDisableBindingFailsIfRoot()
12121212
{

tests/Handler/PathCommandHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ public function testRemoveMappingWithAbsolutePath()
680680

681681
/**
682682
* @expectedException \RuntimeException
683-
* @expectedExceptionMessage The path "/path1" is not mapped in the root package.
683+
* @expectedExceptionMessage The path "/path1" is not mapped in the package "vendor/root".
684684
*/
685685
public function testRemoveMappingFailsIfNotFound()
686686
{

tests/Handler/TypeCommandHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ public function testRemoveType()
595595

596596
/**
597597
* @expectedException \RuntimeException
598-
* @expectedExceptionMessage The type "my/type" does not exist in the root package.
598+
* @expectedExceptionMessage The type "my/type" does not exist in the package "vendor/root".
599599
*/
600600
public function testRemoveTypeFailsIfNotFound()
601601
{

0 commit comments

Comments
 (0)