-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathPromise.php
More file actions
49 lines (41 loc) · 1.48 KB
/
Copy pathPromise.php
File metadata and controls
49 lines (41 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*
* This file is part of the WouterJEloquentBundle package.
*
* (c) 2014 Wouter de Jong
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace WouterJ\EloquentBundle;
use Mockery\MockInterface;
/**
* @author Wouter J <wouter@wouterj.nl>
*/
class Promise
{
public static function containerHasService(MockInterface $container, $service, $instance)
{
$container->allows()->has()->with($service)->andReturn(true);
$container->allows()->get()->with($service)->andReturn($instance);
}
public static function containerDoesNotHaveService(MockInterface $container, $service)
{
$container->allows()->has()->with($service)->andReturn(false);
}
public static function containerHasParameter(MockInterface $container, $name, $value)
{
$container->allows()->hasParameter()->with($name)->andReturn(true);
$container->allows()->getParameter()->with($name)->andReturn($value);
}
public static function inputHasArgument(MockInterface $input, $name, $value)
{
$input->allows()->hasArgument()->with($name)->andReturn(true);
$input->allows()->getArgument()->with($name)->andReturn($value);
}
public static function inputHasOption(MockInterface $input, $name, $value)
{
$input->allows()->hasOption()->with($name)->andReturn(true);
$input->allows()->getOption()->with($name)->andReturn($value);
}
}