| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | declare(strict_types=1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | namespace RoaveTest\ApiCompare\Comparator\BackwardsCompatibility\ClassConstantBased; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use PHPUnit\Framework\MockObject\MockObject; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | use PHPUnit\Framework\TestCase; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | use Roave\ApiCompare\Change; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use Roave\ApiCompare\Changes; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassConstantBased\ConstantBased; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use Roave\ApiCompare\Comparator\BackwardsCompatibility\ClassConstantBased\MultiConstantBased; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use Roave\BetterReflection\Reflection\ReflectionClassConstant; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | final class MultiConstantBasedTest extends TestCase | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 16 |  |  | { | 
            
                                                                        
                            
            
                                    
            
            
                | 17 |  |  |     public function testChecksAllGivenCheckers() : void | 
            
                                                                        
                            
            
                                    
            
            
                | 18 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 19 |  |  |         /** @var ConstantBased|MockObject $checker1 */ | 
            
                                                                        
                            
            
                                    
            
            
                | 20 |  |  |         $checker1 = $this->createMock(ConstantBased::class); | 
            
                                                                        
                            
            
                                    
            
            
                | 21 |  |  |         /** @var ConstantBased|MockObject $checker2 */ | 
            
                                                                        
                            
            
                                    
            
            
                | 22 |  |  |         $checker2 = $this->createMock(ConstantBased::class); | 
            
                                                                        
                            
            
                                    
            
            
                | 23 |  |  |         /** @var ConstantBased|MockObject $checker3 */ | 
            
                                                                        
                            
            
                                    
            
            
                | 24 |  |  |         $checker3 = $this->createMock(ConstantBased::class); | 
            
                                                                        
                            
            
                                    
            
            
                | 25 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 26 |  |  |         $multiCheck = new MultiConstantBased($checker1, $checker2, $checker3); | 
            
                                                                        
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 28 |  |  |         /** @var ReflectionClassConstant|MockObject $from */ | 
            
                                                                        
                            
            
                                    
            
            
                | 29 |  |  |         $from = $this->createMock(ReflectionClassConstant::class); | 
            
                                                                        
                            
            
                                    
            
            
                | 30 |  |  |         /** @var ReflectionClassConstant|MockObject $to */ | 
            
                                                                        
                            
            
                                    
            
            
                | 31 |  |  |         $to = $this->createMock(ReflectionClassConstant::class); | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  |         $checker1 | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  |             ->expects(self::once()) | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  |             ->method('compare') | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  |             ->with($from, $to) | 
            
                                                                        
                            
            
                                    
            
            
                | 37 |  |  |             ->willReturn(Changes::fromArray([ | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  |                 Change::added('1', true), | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  |             ])); | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  |         $checker2 | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  |             ->expects(self::once()) | 
            
                                                                        
                            
            
                                    
            
            
                | 43 |  |  |             ->method('compare') | 
            
                                                                        
                            
            
                                    
            
            
                | 44 |  |  |             ->with($from, $to) | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  |             ->willReturn(Changes::fromArray([ | 
            
                                                                        
                            
            
                                    
            
            
                | 46 |  |  |                 Change::added('2', true), | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  |             ])); | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 49 |  |  |         $checker3 | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |             ->expects(self::once()) | 
            
                                                                        
                            
            
                                    
            
            
                | 51 |  |  |             ->method('compare') | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  |             ->with($from, $to) | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  |             ->willReturn(Changes::fromArray([ | 
            
                                                                        
                            
            
                                    
            
            
                | 54 |  |  |                 Change::added('3', true), | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  |             ])); | 
            
                                                                        
                            
            
                                    
            
            
                | 56 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 57 |  |  |         $this->assertEquals( | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  |             Changes::fromArray([ | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  |                 Change::added('1', true), | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |                 Change::added('2', true), | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |                 Change::added('3', true), | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |             ]), | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |             $multiCheck->compare($from, $to) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 66 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 67 |  |  |  | 
            
                        
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.