Browse Source

Improve wording

Mark Story 6 years ago
parent
commit
8899c7248b
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/ORM/Table.php
  2. 1 1
      tests/TestCase/ORM/AssociationProxyTest.php

+ 2 - 2
src/ORM/Table.php

@@ -2532,10 +2532,10 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
         if (!$association) {
             throw new RuntimeException(sprintf(
                 'Undefined property `%s`. ' .
-                'You have tried to use the `%s` property on %s, but that association does not exist.',
+                'You have not defined the `%s` association on `%s`.',
                 $property,
                 $property,
-                get_class($this),
+                static::class
             ));
         }
 

+ 1 - 1
tests/TestCase/ORM/AssociationProxyTest.php

@@ -68,7 +68,7 @@ class AssociationProxyTest extends TestCase
     public function testGetBadAssociation()
     {
         $this->expectException(\RuntimeException::class);
-        $this->expectExceptionMessage('association does not exist');
+        $this->expectExceptionMessage('You have not defined');
         $articles = $this->getTableLocator()->get('articles');
         $articles->posts;
     }