compile('trait-aliased-constructor-parent-call.php'); global $translator; $compiler = $translator; $headerPath = $compiler->getIncludeDir() . '/php_trait_parent_ce_func_decl.h'; if (file_exists($headerPath)) { @unlink($headerPath); } // Emit the shared function-declaration header (genFunctionDeclarations), which // is what the fix targets. $compiler->genFunctionDeclarations($headerPath); $decl = file_get_contents($headerPath); $this->assertMatchesRegularExpression( '/extern void php_tpdodriver____construct\([^;\n]*trait_parent_ce[^;\n]*\);/', $decl, 'The trait function declaration must include its implicit parent scope' ); $this->assertDoesNotMatchRegularExpression( '/extern void php_(?:driver__tpdodriverconstruct|directdriver____construct)' . '\([^;\n]*trait_parent_ce[^;\n]*\);/', $decl, 'Composing-class wrapper declarations must not expose the implicit parent scope' ); } }