Skip to content

Commit

Permalink
Fixed error in the Helper::isPlaceholder method
Browse files Browse the repository at this point in the history
  • Loading branch information
mjacobus committed Sep 8, 2014
1 parent 7158efb commit 970c598
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Koine/QueryBuilder/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function isString($value)
*/
public function isPlaceholder($value)
{
return preg_match('/^\:[_a-zA-Z]+$/', $value) === 1;
return preg_match('/^\:[_a-zA-Z]/', $value) === 1;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/KoineTests/QueryBuilder/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ public function itQuotesValue()
*/
public function itVerifiesIfValueIsPlaceholder()
{
$this->assertTrue($this->o->isPlaceholder(':placeholder2'));
$this->assertTrue($this->o->isPlaceholder(':placeholder'));
$this->assertTrue($this->o->isPlaceholder(':placeHolder'));
$this->assertTrue($this->o->isPlaceholder(':place_Holder'));
$this->assertFalse($this->o->isPlaceholder('s:st'));
$this->assertFalse($this->o->isPlaceholder('string'));
$this->assertFalse($this->o->isPlaceholder('1'));
$this->assertFalse($this->o->isPlaceholder(':11'));
}

/**
Expand Down

0 comments on commit 970c598

Please sign in to comment.