mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
11bc153deb
* Rewriting and streamlining every unit test with data providers. All unit tests have been rewritten into PHPUnit data providers to reduce the amount of unnecessary code-reuse through out the test suite.
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
namespace Psalm\Tests;
|
|
|
|
class Php40Test extends TestCase
|
|
{
|
|
use Traits\FileCheckerValidCodeParseTestTrait;
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function providerFileCheckerValidCodeParse()
|
|
{
|
|
return [
|
|
'extendOldStyleConstructor' => [
|
|
'<?php
|
|
class A {
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function A() {
|
|
return "hello";
|
|
}
|
|
}
|
|
|
|
class B extends A {
|
|
public function __construct() {
|
|
parent::__construct();
|
|
}
|
|
}'
|
|
],
|
|
'sameNameMethodWithNewStyleConstructor' => [
|
|
'<?php
|
|
class A {
|
|
public function __construct(string $s) { }
|
|
/** @return void */
|
|
public function a(int $i) { }
|
|
}
|
|
new A("hello");'
|
|
]
|
|
];
|
|
}
|
|
}
|