File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change 33namespace Illuminated \Helpers \HelperFunctions \Tests \Db ;
44
55use Illuminated \Helpers \HelperFunctions \Tests \TestCase ;
6- use Mockery ;
76
87class DbMysqlVariableTest extends TestCase
98{
109 /** @test */
1110 public function it_returns_false_for_unexisting_mysql_variable ()
1211 {
13- $ mock = Mockery::mock ('alias:Illuminate\Support\Facades\DB ' );
14- $ mock ->shouldReceive ('selectOne ' )
15- ->withArgs (['show variables where variable_name = ? ' , ['fake ' ]])
16- ->once ()
17- ->andReturnNull ();
12+ $ mock = mock ('alias:Illuminate\Support\Facades\DB ' );
13+ $ mock ->expects ()->selectOne ('show variables where variable_name = ? ' , ['fake ' ])->andReturnNull ();
1814
1915 $ this ->assertFalse (db_mysql_variable ('fake ' ));
2016 }
2117
2218 /** @test */
2319 public function it_returns_value_for_existing_mysql_variable ()
2420 {
25- $ mock = Mockery::mock ('alias:Illuminate\Support\Facades\DB ' );
26- $ mock ->shouldReceive ('selectOne ' )
27- ->withArgs (['show variables where variable_name = ? ' , ['hostname ' ]])
28- ->once ()
29- ->andReturnUsing (function () {
30- return (object ) ['Variable_name ' => 'hostname ' , 'Value ' => 'localhost ' ];
31- });
21+ $ mock = mock ('alias:Illuminate\Support\Facades\DB ' );
22+ $ mock ->expects ()->selectOne ('show variables where variable_name = ? ' , ['hostname ' ])
23+ ->andReturn ((object ) ['Variable_name ' => 'hostname ' , 'Value ' => 'localhost ' ]);
3224
3325 $ this ->assertEquals ('localhost ' , db_mysql_variable ('hostname ' ));
3426 }
You can’t perform that action at this time.
0 commit comments