We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
db_mysql_now
1 parent 33c7b8d commit a1db161Copy full SHA for a1db161
tests/db/DbMysqlNowTest.php
@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+use Mockery as m;
4
5
+class DbMysqlNowTest extends TestCase
6
+{
7
+ /** @test */
8
+ public function it_returns_valid_mysql_now()
9
+ {
10
+ $mock = m::mock('alias:Illuminate\Support\Facades\DB');
11
+ $mock->shouldReceive('selectOne')->withArgs(['select now() as now'])->once()->andReturnUsing(function () {
12
+ $object = new StdClass();
13
+ $object->now = '2016-09-17 18:49:46';
14
+ return $object;
15
+ });
16
17
+ $this->assertEquals('2016-09-17 18:49:46', db_mysql_now());
18
+ }
19
+}
0 commit comments