TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
723 B

<?php
/**
* Zend abstract-method declaration rules: an abstract method may not
* carry a body, and abstract private is only legal inside traits.
*/
class AbstractMethodDeclarationTest extends BaseTest
{
public function testAbstractMethodCannotContainBody(): void
{
$this->exec('Abstract function `Job::run()` cannot contain body', 'abstract_rule_body.php');
}
public function testAbstractClassMethodCannotBePrivate(): void
{
$this->exec('Abstract function `Job::run()` cannot be declared private', 'abstract_rule_private.php');
}
public function testAbstractPrivateTraitMethodIsAllowed(): void
{
$this->compile('abstract_rule_private_trait_valid.php');
}
}