| 1 | <?php |
||
| 8 | class Example |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string Name of this example |
||
| 12 | */ |
||
| 13 | private $name; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string Example code |
||
| 17 | */ |
||
| 18 | private $code = ''; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var Expectation\ExpectationInterface[] List of expectations |
||
| 22 | */ |
||
| 23 | private $expectations = array(); |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Set name of example |
||
| 27 | * |
||
| 28 | * @param string $name |
||
| 29 | */ |
||
| 30 | public function __construct($name) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Get name of example |
||
| 37 | * |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function getName() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Add line to example code |
||
| 47 | * |
||
| 48 | * @param string $line |
||
| 49 | * @return null |
||
| 50 | */ |
||
| 51 | public function addLine($line) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get example code block |
||
| 58 | * |
||
| 59 | * @return CodeBlock |
||
| 60 | */ |
||
| 61 | public function getCodeBlock() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Add expectation to example |
||
| 68 | * |
||
| 69 | * @param Expectation\ExpectationInterface $expectation |
||
| 70 | * @return null |
||
| 71 | */ |
||
| 72 | public function addExpectation(Expectation\ExpectationInterface $expectation) |
||
| 76 | |||
| 77 | /** |
||
| 78 | * Get registered expectations |
||
| 79 | * |
||
| 80 | * @return Expectation\ExpectationInterface[] |
||
| 81 | */ |
||
| 82 | public function getExpectations() |
||
| 86 | } |
||
| 87 |