Skip to content

Commit bd26b77

Browse files
committed
Running tests on Laravel 5.1
1 parent 9737b9b commit bd26b77

File tree

6 files changed

+97
-104
lines changed

6 files changed

+97
-104
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"illuminate/events": "^5.0"
1818
},
1919
"require-dev": {
20-
"orchestra/testbench": "3.0.*",
20+
"orchestra/testbench": "~3.1.0",
2121
"mockery/mockery": "*",
2222
"satooshi/php-coveralls": "*"
2323
},

src/Jenssegers/Mongodb/Model.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,7 @@ protected function asDateTime($value)
196196
*/
197197
protected function getDateFormat()
198198
{
199-
return 'Y-m-d H:i:s';
200-
}
201-
202-
/**
203-
* Get a fresh timestamp for the model.
204-
*
205-
* @return MongoDate
206-
*/
207-
public function freshTimestamp()
208-
{
209-
return new MongoDate;
199+
return $this->dateFormat ?: 'Y-m-d H:i:s';
210200
}
211201

212202
/**
@@ -216,9 +206,7 @@ public function freshTimestamp()
216206
*/
217207
public function getTable()
218208
{
219-
if (isset($this->collection)) return $this->collection;
220-
221-
return parent::getTable();
209+
return $this->collection ?: parent::getTable();
222210
}
223211

224212
/**

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ public function lists($column, $key = null)
620620
return $item;
621621
});
622622

623-
return $results->lists($column, $key);
623+
return $results->lists($column, $key)->all();
624624
}
625625

626626
return parent::lists($column, $key);

src/Jenssegers/Mongodb/Relations/EmbedsOneOrMany.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ public function createMany(array $records)
212212
*/
213213
protected function getIdsArrayFrom($ids)
214214
{
215+
if ($ids instanceof Collection)
216+
{
217+
$ids = $ids->all();
218+
}
219+
215220
if ( ! is_array($ids)) $ids = [$ids];
216221

217222
foreach ($ids as &$id)

0 commit comments

Comments
 (0)