1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
psalm/tests/AssignmentTest.php

41 lines
869 B
PHP
Raw Normal View History

<?php
namespace Psalm\Tests;
class AssignmentTest extends TestCase
{
use Traits\FileCheckerInvalidCodeParseTestTrait;
use Traits\FileCheckerValidCodeParseTestTrait;
2017-01-13 20:07:23 +01:00
/**
* @return array
2017-01-13 20:07:23 +01:00
*/
public function providerFileCheckerValidCodeParse()
{
return [
'nestedAssignment' => [
'<?php
$a = $b = $c = 5;',
'assertions' => [
['int' => '$a']
]
]
];
}
/**
* @return array
*/
public function providerFileCheckerInvalidCodeParse()
{
return [
'mixedAssignment' => [
'<?php
/** @var mixed */
$a = 5;
$b = $a;',
'error_message' => 'MixedAssignment'
]
];
2017-02-13 00:06:18 +01:00
}
}