1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add test for specific issue mentioned in #74

This commit is contained in:
Matthew Brown 2017-01-23 14:19:08 -07:00
parent daa923e243
commit 35617e9d84

View File

@ -453,6 +453,38 @@ class InterfaceTest extends PHPUnit_Framework_TestCase
$file_checker->visitAndAnalyzeMethods($context);
}
/**
* @return void
*/
public function testImplementsPartialInterfaceMethods()
{
Config::getInstance()->setCustomErrorLevel('MissingReturnType', Config::REPORT_SUPPRESS);
$stmts = self::$parser->parse('<?php
namespace Bat;
interface I {
public function foo();
public function bar();
}
abstract class A implements I {
public function foo() {
return "hello";
}
}
class B extends A {
public function bar() {
return "goodbye";
}
}
');
$file_checker = new FileChecker('somefile.php', $this->project_checker, $stmts);
$context = new Context();
$file_checker->visitAndAnalyzeMethods($context);
}
/**
* @expectedException \Psalm\Exception\CodeException
* @expectedExceptionMessage UnimplementedInterfaceMethod