Permalink
Browse files

Fixing more tests for hhvm

  • Loading branch information...
lorenzo committed Feb 12, 2014
1 parent 386c430 commit 42c24139777f49bdfb1f6ff407bf6a5dd68fca20
@@ -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'])
@@ -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));
@@ -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));
@@ -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]

0 comments on commit 42c2413

Please sign in to comment.