Skip to content

Commit

Permalink
Fixing more tests for hhvm
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 13, 2014
1 parent 386c430 commit 42c2413
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Model/Behavior/TranslateBehavior.php
Expand Up @@ -169,7 +169,8 @@ public function beforeSave(Event $event, Entity $entity, ArrayObject $options) {
$options['associated'] = $newOptions + $options['associated'];
$values = $entity->extract($this->config()['fields'], true);
$fields = array_keys($values);
$key = $entity->get(current((array)$this->_table->primaryKey()));
$primaryKey = (array)$this->_table->primaryKey();
$key = $entity->get(current($primaryKey));

$preexistent = TableRegistry::get('I18n')->find()
->select(['id', 'field'])
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Database/Schema/SqliteSchemaTest.php
Expand Up @@ -811,6 +811,7 @@ public function testTruncateSql() {
'\PDOStatement',
['execute', 'rowCount', 'closeCursor', 'fetch']
);
$statement->queryString = '';
$driver->connection()->expects($this->once())->method('prepare')
->with('SELECT 1 FROM sqlite_master WHERE name = "sqlite_sequence"')
->will($this->returnValue($statement));
Expand Down Expand Up @@ -841,6 +842,7 @@ public function testTruncateSqlNoSequences() {
'\PDOStatement',
['execute', 'rowCount', 'closeCursor', 'fetch']
);
$statement->queryString = '';
$driver->connection()->expects($this->once())->method('prepare')
->with('SELECT 1 FROM sqlite_master WHERE name = "sqlite_sequence"')
->will($this->returnValue($statement));
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/ORM/QueryTest.php
Expand Up @@ -806,9 +806,9 @@ public function testMapReduceOnlyMapper() {
$query->mapReduce()
);

$this->assertEquals($query, $query->mapReduce($mapper1));
$this->assertEquals($query, $query->mapReduce($mapper2));
$result = $query->mapReduce();
$this->assertEquals(
$this->assertSame(
[
['mapper' => $mapper1, 'reducer' => null],
['mapper' => $mapper2, 'reducer' => null]
Expand Down

0 comments on commit 42c2413

Please sign in to comment.