File tree Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ public function it_returns_valid_mysql_now()
9
9
{
10
10
$ mock = m::mock ('alias:Illuminate\Support\Facades\DB ' );
11
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 ;
12
+ return (object ) ['now ' => '2016-09-17 18:49:46 ' ];
15
13
});
16
14
17
15
$ this ->assertEquals ('2016-09-17 18:49:46 ' , db_mysql_now ());
Original file line number Diff line number Diff line change @@ -24,10 +24,7 @@ public function it_returns_value_for_known_mysql_variable()
24
24
->withArgs (['show variables where variable_name = ? ' , ['hostname ' ]])
25
25
->once ()
26
26
->andReturnUsing (function () {
27
- $ object = new StdClass ();
28
- $ object ->Variable_name = 'hostname ' ;
29
- $ object ->Value = 'localhost ' ;
30
- return $ object ;
27
+ return (object ) ['Variable_name ' => 'hostname ' , 'Value ' => 'localhost ' ];
31
28
});
32
29
33
30
$ this ->assertEquals ('localhost ' , db_mysql_variable ('hostname ' ));
Original file line number Diff line number Diff line change @@ -113,10 +113,7 @@ public function it_returns_true_with_json_encoded_array_passed()
113
113
/** @test */
114
114
public function it_returns_true_with_json_encoded_object_passed ()
115
115
{
116
- $ object = new StdClass ();
117
- $ object ->foo = 'bar ' ;
118
- $ object ->baz = 'bax ' ;
119
- $ json = json_encode ($ object );
116
+ $ json = json_encode ((object ) ['foo ' => 'bar ' , 'baz ' => 'bax ' ]);
120
117
$ this ->assertTrue (is_json ($ json ));
121
118
}
122
119
You can’t perform that action at this time.
0 commit comments