Skip to content

Commit

Permalink
Add a bit more documentation and fix up tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 3, 2017
1 parent 18875a9 commit 314f11c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/Database/Expression/IdentifierExpression.php
Expand Up @@ -18,7 +18,12 @@
use Cake\Database\ValueBinder;

/**
* Represents a single identifier name in the database
* Represents a single identifier name in the database.
*
* Identifier values are unsafe with user supplied data.
* Values will be quoted when identifier quoting is enabled.
*
* @see \Cake\Database\Query::identifier()
*/
class IdentifierExpression implements ExpressionInterface
{
Expand Down
5 changes: 0 additions & 5 deletions tests/TestCase/Database/QueryTest.php
Expand Up @@ -16,7 +16,6 @@

use Cake\Database\Expression\IdentifierExpression;
use Cake\Database\ExpressionInterface;
use Cake\Database\IdentifierInterface;
use Cake\Database\Query;
use Cake\Database\StatementInterface;
use Cake\Database\TypeMap;
Expand Down Expand Up @@ -3394,13 +3393,9 @@ public function testIdentifierExpression()
public function testIdentifierInterface()
{
$query = new Query($this->connection);
/* @var \Cake\Database\IdentifierInterface $identifier */
$identifier = $query->identifier('description');

// should support these interfaces
$this->assertInstanceOf(IdentifierInterface::class, $identifier);
$this->assertInstanceOf(ExpressionInterface::class, $identifier);

$this->assertEquals('description', $identifier->getIdentifier());

$identifier->setIdentifier('title');
Expand Down

0 comments on commit 314f11c

Please sign in to comment.