| @@ 42-53 (lines=12) @@ | ||
| 39 | * |
|
| 40 | * @return void |
|
| 41 | */ |
|
| 42 | public function testAdapterDelegatesClassNodeToRuleSet() |
|
| 43 | { |
|
| 44 | $mock = $this->getPHPDependClassMock(); |
|
| 45 | $mock->expects($this->once()) |
|
| 46 | ->method('isUserDefined') |
|
| 47 | ->willReturn(true); |
|
| 48 | ||
| 49 | $adapter = new Parser($this->getPHPDependMock()); |
|
| 50 | $adapter->addRuleSet($this->getRuleSetMock(ClassNode::class)); |
|
| 51 | $adapter->setReport($this->getReportMock(0)); |
|
| 52 | $adapter->visitClass($mock); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Tests that the metrics adapter does not delegate a node without source |
|
| @@ 61-72 (lines=12) @@ | ||
| 58 | * |
|
| 59 | * @return void |
|
| 60 | */ |
|
| 61 | public function testAdapterDoesNotDelegateNonSourceClassNodeToRuleSet() |
|
| 62 | { |
|
| 63 | $mock = $this->getPHPDependClassMock(); |
|
| 64 | $mock->expects($this->once()) |
|
| 65 | ->method('isUserDefined') |
|
| 66 | ->willReturn(false); |
|
| 67 | ||
| 68 | $adapter = new Parser($this->getPHPDependMock()); |
|
| 69 | $adapter->addRuleSet($this->getRuleSetMock()); |
|
| 70 | $adapter->setReport($this->getReportMock(0)); |
|
| 71 | $adapter->visitClass($mock); |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * Tests that the metrics adapter delegates a node to a registered rule-set. |
|