Skip to content

Commit a1db161

Browse files
committed
IHF: db_mysql_now helper fully covered by tests.
1 parent 33c7b8d commit a1db161

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/db/DbMysqlNowTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)