diff --git a/tests/db/DbMysqlNowTest.php b/tests/db/DbMysqlNowTest.php index e1d1406..95db6f4 100644 --- a/tests/db/DbMysqlNowTest.php +++ b/tests/db/DbMysqlNowTest.php @@ -9,9 +9,7 @@ public function it_returns_valid_mysql_now() { $mock = m::mock('alias:Illuminate\Support\Facades\DB'); $mock->shouldReceive('selectOne')->withArgs(['select now() as now'])->once()->andReturnUsing(function () { - $object = new StdClass(); - $object->now = '2016-09-17 18:49:46'; - return $object; + return (object) ['now' => '2016-09-17 18:49:46']; }); $this->assertEquals('2016-09-17 18:49:46', db_mysql_now()); diff --git a/tests/db/DbMysqlVariableTest.php b/tests/db/DbMysqlVariableTest.php index b9fc1a4..88aa7ef 100644 --- a/tests/db/DbMysqlVariableTest.php +++ b/tests/db/DbMysqlVariableTest.php @@ -24,10 +24,7 @@ public function it_returns_value_for_known_mysql_variable() ->withArgs(['show variables where variable_name = ?', ['hostname']]) ->once() ->andReturnUsing(function () { - $object = new StdClass(); - $object->Variable_name = 'hostname'; - $object->Value = 'localhost'; - return $object; + return (object) ['Variable_name' => 'hostname', 'Value' => 'localhost']; }); $this->assertEquals('localhost', db_mysql_variable('hostname')); diff --git a/tests/json/IsJsonTest.php b/tests/json/IsJsonTest.php index c4c8264..4503aee 100644 --- a/tests/json/IsJsonTest.php +++ b/tests/json/IsJsonTest.php @@ -113,10 +113,7 @@ public function it_returns_true_with_json_encoded_array_passed() /** @test */ public function it_returns_true_with_json_encoded_object_passed() { - $object = new StdClass(); - $object->foo = 'bar'; - $object->baz = 'bax'; - $json = json_encode($object); + $json = json_encode((object) ['foo' => 'bar', 'baz' => 'bax']); $this->assertTrue(is_json($json)); }