File tree 6 files changed +16
-16
lines changed
6 files changed +16
-16
lines changed Original file line number Diff line number Diff line change 3
3
4
4
namespace DesignPatterns \Structural \Facade ;
5
5
6
- interface BiosInterface
6
+ interface Bios
7
7
{
8
8
public function execute ();
9
9
10
10
public function waitForKeyPress ();
11
11
12
- public function launch (OsInterface $ os );
12
+ public function launch (OperatingSystem $ os );
13
13
14
14
public function powerDown ();
15
15
}
Original file line number Diff line number Diff line change 6
6
class Facade
7
7
{
8
8
/**
9
- * @var OsInterface
9
+ * @var OperatingSystem
10
10
*/
11
11
private $ os ;
12
12
13
13
/**
14
- * @var BiosInterface
14
+ * @var Bios
15
15
*/
16
16
private $ bios ;
17
17
18
18
/**
19
- * @param BiosInterface $bios
20
- * @param OsInterface $os
19
+ * @param Bios $bios
20
+ * @param OperatingSystem $os
21
21
*/
22
- public function __construct (BiosInterface $ bios , OsInterface $ os )
22
+ public function __construct (Bios $ bios , OperatingSystem $ os )
23
23
{
24
24
$ this ->bios = $ bios ;
25
25
$ this ->os = $ os ;
Original file line number Diff line number Diff line change 3
3
4
4
namespace DesignPatterns \Structural \Facade ;
5
5
6
- interface OsInterface
6
+ interface OperatingSystem
7
7
{
8
8
public function halt ();
9
9
Original file line number Diff line number Diff line change @@ -41,15 +41,15 @@ Facade.php
41
41
:language: php
42
42
:linenos:
43
43
44
- OsInterface .php
44
+ OperatingSystem .php
45
45
46
- .. literalinclude :: OsInterface .php
46
+ .. literalinclude :: OperatingSystem .php
47
47
:language: php
48
48
:linenos:
49
49
50
- BiosInterface .php
50
+ Bios .php
51
51
52
- .. literalinclude :: BiosInterface .php
52
+ .. literalinclude :: Bios .php
53
53
:language: php
54
54
:linenos:
55
55
Original file line number Diff line number Diff line change 4
4
namespace DesignPatterns \Structural \Facade \Tests ;
5
5
6
6
use DesignPatterns \Structural \Facade \Facade ;
7
- use DesignPatterns \Structural \Facade \OsInterface ;
7
+ use DesignPatterns \Structural \Facade \OperatingSystem ;
8
8
use PHPUnit \Framework \TestCase ;
9
9
10
10
class FacadeTest extends TestCase
11
11
{
12
12
public function testComputerOn ()
13
13
{
14
- /** @var OsInterface |\PHPUnit_Framework_MockObject_MockObject $os */
15
- $ os = $ this ->createMock ('DesignPatterns\Structural\Facade\OsInterface ' );
14
+ /** @var OperatingSystem |\PHPUnit_Framework_MockObject_MockObject $os */
15
+ $ os = $ this ->createMock ('DesignPatterns\Structural\Facade\OperatingSystem ' );
16
16
17
17
$ os ->method ('getName ' )
18
18
->will ($ this ->returnValue ('Linux ' ));
19
19
20
- $ bios = $ this ->getMockBuilder ('DesignPatterns\Structural\Facade\BiosInterface ' )
20
+ $ bios = $ this ->getMockBuilder ('DesignPatterns\Structural\Facade\Bios ' )
21
21
->setMethods (['launch ' , 'execute ' , 'waitForKeyPress ' ])
22
22
->disableAutoload ()
23
23
->getMock ();
You can’t perform that action at this time.
0 commit comments