Skip to content
Permalink
Browse files

Fix formatting and spacing.

Refs #8824
  • Loading branch information...
markstory committed May 18, 2016
1 parent e869e26 commit e47c09bc43f3bed5e02c783c165bcde0a1778468
Showing with 12 additions and 6 deletions.
  1. +8 −3 src/ORM/Marshaller.php
  2. +4 −3 tests/TestCase/ORM/MarshallerTest.php
@@ -20,7 +20,6 @@
use Cake\Database\Type;
use Cake\Datasource\EntityInterface;
use Cake\Datasource\InvalidPropertyInterface;
use Cake\ORM\Exception\MissingAssociationException;
use RuntimeException;
/**
@@ -81,8 +80,14 @@ protected function _buildPropertyMap($options)
$map[$assoc->property()] = ['association' => $assoc] + $nested + ['associated' => []];
continue;
}
if (substr($key, 0, 1) !== "_") { // if $key is not a special underscored field eg _ids or _joinData
throw new \InvalidArgumentException(vsprintf("%s is not associated with %s",[$this->_table->alias(), $key]));
// If the key is not a special field like _ids or _joinData
// it is a missing association that we should error on.
if (substr($key, 0, 1) !== "_") {
throw new \InvalidArgumentException(sprintf(
"'%s' is not associated with '%s'",
$this->_table->alias(),
$key
));
}
}
return $map;
@@ -1133,8 +1133,9 @@ public function testManyAssociations()
}
/**
* Test if exceptin is raised when called with [associated=>NonExistingAssociation]
* Previously such association has been simply ignored
* Test if exception is raised when called with [associated => NonExistingAssociation]
* Previously such association were simply ignored
*
* @expectedException \InvalidArgumentException
* @return void
*/
@@ -1157,7 +1158,7 @@ public function testManyInvalidAssociation()
],
];
$marshall = new Marshaller($this->comments);
$marshall->many($data, ['associated' => ['Users','People']]);
$marshall->many($data, ['associated' => ['Users', 'People']]);
}
/**

0 comments on commit e47c09b

Please sign in to comment.
You can’t perform that action at this time.