Skip to content

cannot recognise trait methods #30

@miklcct

Description

@miklcct

I'm testing my codebase miklcct/thin_php_app and in two of the test files phpstan throws an error:

 ------ ------------------------------------------------------------------------------------ 
  Line   test/View/StreamToStringTest.php                                                    
 ------ ------------------------------------------------------------------------------------ 
  16     Call to an undefined method PHPUnit\Framework\MockObject\MockObject::__toString().  
 ------ ------------------------------------------------------------------------------------ 

 ------ -------------------------------------------------------------------------------- 
  Line   test/View/StringToStreamTest.php                                                
 ------ -------------------------------------------------------------------------------- 
  16     Call to an undefined method PHPUnit\Framework\MockObject\MockObject::render().  
 ------ -------------------------------------------------------------------------------- 

The mock objects are created by $iut = $this->getMockForTrait(StreamToString::class); and $iut = $this->getMockForTrait(StringToStream::class);, and the traits have the mentioned methods defined. PhpStorm type hints work on these 2 files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions