|
@@ 69-93 (lines=25) @@
|
| 66 |
|
$this->assertSame($reflectionFunctionMock, $sortedElements[1]); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
public function testSortElementsByFqnMethod(): void |
| 70 |
|
{ |
| 71 |
|
$reflectionMethodMock = $this->createMock( |
| 72 |
|
[ReflectionInterface::class, InClassInterface::class] |
| 73 |
|
); |
| 74 |
|
$reflectionMethodMock->method('getDeclaringClassName') |
| 75 |
|
->willReturn('B'); |
| 76 |
|
$reflectionMethodMock->method('getName') |
| 77 |
|
->willReturn('C'); |
| 78 |
|
|
| 79 |
|
$reflectionMethodMock2 = $this->createMock( |
| 80 |
|
[ReflectionInterface::class, InClassInterface::class] |
| 81 |
|
); |
| 82 |
|
$reflectionMethodMock2->method('getDeclaringClassName') |
| 83 |
|
->willReturn('A'); |
| 84 |
|
$reflectionMethodMock2->method('getName') |
| 85 |
|
->willReturn('D'); |
| 86 |
|
|
| 87 |
|
$elements = [$reflectionMethodMock, $reflectionMethodMock2]; |
| 88 |
|
|
| 89 |
|
$sortedElements = $this->elementSorter->sortElementsByFqn($elements); |
| 90 |
|
$this->assertNotSame($elements, $sortedElements); |
| 91 |
|
$this->assertSame($reflectionMethodMock2, $sortedElements[0]); |
| 92 |
|
$this->assertSame($reflectionMethodMock, $sortedElements[1]); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
public function testSortElementsByFqnProperties(): void |
| 96 |
|
{ |
|
@@ 95-115 (lines=21) @@
|
| 92 |
|
$this->assertSame($reflectionMethodMock, $sortedElements[1]); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
public function testSortElementsByFqnProperties(): void |
| 96 |
|
{ |
| 97 |
|
$reflectionMethodMock = $this->createMock([ReflectionInterface::class, InClassInterface::class]); |
| 98 |
|
$reflectionMethodMock->method('getDeclaringClassName') |
| 99 |
|
->willReturn('B'); |
| 100 |
|
$reflectionMethodMock->method('getName') |
| 101 |
|
->willReturn('C'); |
| 102 |
|
|
| 103 |
|
$reflectionMethodMock2 = $this->createMock([ReflectionInterface::class, InClassInterface::class]); |
| 104 |
|
$reflectionMethodMock2->method('getDeclaringClassName') |
| 105 |
|
->willReturn('A'); |
| 106 |
|
$reflectionMethodMock2->method('getName') |
| 107 |
|
->willReturn('D'); |
| 108 |
|
|
| 109 |
|
$elements = [$reflectionMethodMock, $reflectionMethodMock2]; |
| 110 |
|
|
| 111 |
|
$sortedElements = $this->elementSorter->sortElementsByFqn($elements); |
| 112 |
|
$this->assertNotSame($elements, $sortedElements); |
| 113 |
|
$this->assertSame($reflectionMethodMock2, $sortedElements[0]); |
| 114 |
|
$this->assertSame($reflectionMethodMock, $sortedElements[1]); |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
public function testSortElementsByFqnNonSupportedType(): void |
| 118 |
|
{ |