2017-02-11 03:27:12 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Tests;
|
|
|
|
|
2018-01-21 16:22:04 +01:00
|
|
|
use Psalm\Context;
|
2017-02-11 03:27:12 +01:00
|
|
|
|
2017-04-25 05:45:02 +02:00
|
|
|
class BadFormatTest extends TestCase
|
2017-02-11 03:27:12 +01:00
|
|
|
{
|
|
|
|
/**
|
2018-09-29 06:15:39 +02:00
|
|
|
* @expectedException Psalm\Exception\CodeException
|
|
|
|
* @expectedExceptionMessage ParseError - somefile.php:9
|
2017-02-11 03:27:12 +01:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function testMissingSemicolon()
|
|
|
|
{
|
2017-07-25 22:11:02 +02:00
|
|
|
$this->addFile(
|
2017-04-25 05:45:02 +02:00
|
|
|
'somefile.php',
|
2017-02-11 03:27:12 +01:00
|
|
|
'<?php
|
2017-07-25 22:11:02 +02:00
|
|
|
class A {
|
|
|
|
/** @var int|null */
|
|
|
|
protected $hello;
|
2017-02-11 03:27:12 +01:00
|
|
|
|
2017-07-25 22:11:02 +02:00
|
|
|
/** @return void */
|
|
|
|
function foo() {
|
|
|
|
$this->hello = 5
|
|
|
|
}
|
|
|
|
}'
|
2017-02-11 03:27:12 +01:00
|
|
|
);
|
|
|
|
|
2018-01-21 16:22:04 +01:00
|
|
|
$this->analyzeFile('somefile.php', new Context());
|
2017-02-11 03:27:12 +01:00
|
|
|
}
|
|
|
|
}
|