| Code Coverage
| Classes and Traits | Functions and Methods | Lines
Total | 0.00% covered (danger) | 0.00% | 0 / 1 | 50.00% covered (warning) | 50.00% | 2 / 4 | CRAP | 75.00% covered (warning) | 75.00% | 6 / 8
MockDefinition | 0.00% covered (danger) | 0.00% | 0 / 1 | 50.00% covered (warning) | 50.00% | 2 / 4 | 5.39 | 75.00% covered (warning) | 75.00% | 6 / 8
__construct(MockConfiguration $config, $code) | 0.00% covered (danger) | 0.00% | 0 / 1 | 2.03 | 80.00% covered (warning) | 80.00% | 4 / 5
getConfig() | 0.00% covered (danger) | 0.00% | 0 / 1 | 2 | 0.00% covered (danger) | 0.00% | 0 / 1
getClassName() | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 1 / 1
getCode() | 100.00% covered (success) | 100.00% | 1 / 1 | 1 | 100.00% covered (success) | 100.00% | 1 / 1

1 | <?php
2 |
3 | namespace Mockery\Generator;
4 |
5 | class MockDefinition
6 | {
7 | protected $config;
8 | protected $code;
9 |
10 | public function __construct(MockConfiguration $config, $code)
11 | {
12 | if (!$config->getName()) {
13 | throw new \InvalidArgumentException("MockConfiguration must contain a name");
14 | }
15 | $this->config = $config;
16 | $this->code = $code;
17 | }
18 |
19 | public function getConfig()
20 | {
21 | return $this->config;
22 | }
23 |
24 | public function getClassName()
25 | {
26 | return $this->config->getName();
27 | }
28 |
29 | public function getCode()
30 | {
31 | return $this->code;
32 | }
33 | }