Add some trait use factory builder integration tests

This commit is contained in:
ProgMiner 2018-07-22 16:30:39 +03:00 committed by Nikita Popov
parent 8d9ae46597
commit 82e8b33814

View File

@ -263,6 +263,14 @@ class BuilderFactoryTest extends TestCase
->implement('A\Few', '\Interfaces')
->makeAbstract()
->addStmt($factory->useTrait('FirstTrait'))
->addStmt($factory->useTrait('SecondTrait', 'ThirdTrait')
->and('AnotherTrait')
->with($factory->traitUseAdaptation('foo')->as('bar'))
->with($factory->traitUseAdaptation('AnotherTrait', 'baz')->as('test'))
->with($factory->traitUseAdaptation('AnotherTrait', 'func')->insteadof('SecondTrait')))
->addStmt($factory->method('firstMethod'))
->addStmt($factory->method('someMethod')
@ -298,6 +306,12 @@ use function strlen;
use const PHP_VERSION;
abstract class SomeClass extends SomeOtherClass implements A\Few, \Interfaces
{
use FirstTrait;
use SecondTrait, ThirdTrait, AnotherTrait {
foo as bar;
AnotherTrait::baz as test;
AnotherTrait::func insteadof SecondTrait;
}
protected $someProperty;
private $anotherProperty = array(1, 2, 3);
function firstMethod()