test(assign): 添加严格类型声明为0的测试用例

- 新增 testStrictTypesZeroNotAllowed 测试方法
- 验证 declare(strict_types=0) 不被允许的情况
- 添加对应的测试代码文件 declare-strict-types-zero.php
- 确保只有 strict_types=1 被支持的功能测试
pull/1/head
韩天峰 3 months ago
parent 31bd1ae256
commit 64e9d76770
  1. 2
      phpunit/code/declare-strict-types-zero.php
  2. 5
      phpunit/src/AssignTest.php

@ -0,0 +1,2 @@
<?php
declare(strict_types=0);

@ -124,4 +124,9 @@ class AssignTest extends \BaseTest
{
$this->exec("Cannot re-assign `\$x` from `php::Str` to `php::Array`", 're-assign-str-to-array.php');
}
public function testStrictTypesZeroNotAllowed()
{
$this->exec("declare(strict_types=0) is not allowed, only strict_types=1 is supported", 'declare-strict-types-zero.php');
}
}

Loading…
Cancel
Save