Skip to content

Commit

Permalink
Add the registry alias to debug table debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
AD7six committed Feb 17, 2015
1 parent 4e9dfb3 commit 4911a53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ORM/Table.php
Expand Up @@ -2158,6 +2158,7 @@ public function __debugInfo()
{
$conn = $this->connection();
return [
'registryAlias' => $this->registryAlias(),
'table' => $this->table(),
'alias' => $this->alias(),
'entityClass' => $this->entityClass(),
Expand Down
15 changes: 15 additions & 0 deletions tests/TestCase/ORM/TableTest.php
Expand Up @@ -3508,6 +3508,7 @@ public function testDebugInfo()
$articles->addBehavior('Timestamp');
$result = $articles->__debugInfo();
$expected = [
'registryAlias' => 'articles',
'table' => 'articles',
'alias' => 'articles',
'entityClass' => 'TestApp\Model\Entity\Article',
Expand All @@ -3517,6 +3518,20 @@ public function testDebugInfo()
'connectionName' => 'test'
];
$this->assertEquals($expected, $result);

$articles = TableRegistry::get('Foo.Articles');
$result = $articles->__debugInfo();
$expected = [
'registryAlias' => 'Foo.Articles',
'table' => 'articles',
'alias' => 'Articles',
'entityClass' => '\Cake\ORM\Entity',
'associations' => [],
'behaviors' => [],
'defaultConnection' => 'default',
'connectionName' => 'test'
];
$this->assertEquals($expected, $result);
}

/**
Expand Down

0 comments on commit 4911a53

Please sign in to comment.