+++ /dev/null
-<?php
-
-class simple {
- var $simple_prop = 100;
-
- function simple()
- {
- print "I'm alive!\n";
- }
-}
-
-class helper {
- var $my_prop = 5;
- var $your_prop = array('init' => PHP_VERSION);
- var $our_prop = '****';
- var $_priv_prop = null;
-
- function helper()
- {
- print "just trying to help\n";
- }
-
- function do_this()
- {
- print "I'm helping!\n";
- }
-
- function do_that()
- {
- print "I'm aggregating!\n";
- }
-
- function just_another_method()
- {
- print "yep, that's me\n";
- }
-
- function _private()
- {
- print "Don't touch me!\n";
- }
-
- function __wakeup()
- {
- }
-}
-
-class mixin {
- var $simple_prop = true;
- var $mix = true;
-
- function mix_it()
- {
- print "mixing\n";
- }
-}
-
-class moby {
- function mix_it()
- {
- print "I'm redundant!\n";
- }
-}
-
-?>
+++ /dev/null
---TEST--
-aggregating everything
---FILE--
-<?php
-
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate($obj, 'helper');
-$obj->do_this();
-$obj->do_that();
-print $obj->our_prop;
-
-?>
---EXPECT--
-I'm alive!
-I'm helping!
-I'm aggregating!
-****
+++ /dev/null
---TEST--
-aggregating all methods
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate_methods($obj, 'mixin');
-$obj->mix_it();
-print $obj->simple_prop."\n";
-print implode(',', get_class_methods($obj))."\n";
-print implode(',', array_keys(get_object_vars($obj)))."\n";
-aggregate_methods($obj, 'moby');
-$obj->mix_it();
-
-?>
---EXPECT--
-I'm alive!
-mixing
-100
-simple,mix_it
-simple_prop
-mixing
+++ /dev/null
---TEST--
-aggregating methods specified in the list
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate_methods_by_list($obj, 'helper', array('just_another_method'));
-print implode(',', get_class_methods($obj))."\n";
-$obj2 = new simple();
-aggregate_methods_by_list($obj2, 'helper', array('just_another_method'), true);
-print implode(',', get_class_methods($obj2))."\n";
-$obj->just_another_method();
-?>
---EXPECT--
-I'm alive!
-simple,just_another_method
-I'm alive!
-simple,do_this,do_that
-yep, that's me
+++ /dev/null
---TEST--
-aggregating methods matching regular expression
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate_methods_by_regexp($obj, 'helper', '/^do/');
-print implode(',', get_class_methods($obj))."\n";
-$obj2 = new simple();
-aggregate_methods_by_regexp($obj2, 'helper', '/^do/', true);
-print implode(',', get_class_methods($obj2))."\n";
-?>
---EXPECT--
-I'm alive!
-simple,do_this,do_that
-I'm alive!
-simple,just_another_method
+++ /dev/null
---TEST--
-aggregating all default properties
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate_properties($obj, 'mixin');
-print implode(',', array_keys(get_object_vars($obj)))."\n";
-print $obj->simple_prop."\n";
-print implode(',', get_class_methods($obj))."\n";
-?>
---EXPECT--
-I'm alive!
-simple_prop,mix
-100
-simple
+++ /dev/null
---TEST--
-aggregating default properties specified in the list
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate_properties_by_list($obj, 'helper', array('my_prop', 'our_prop'));
-print implode(',', array_keys(get_object_vars($obj)))."\n";
-$obj2 = new simple();
-aggregate_properties_by_list($obj2, 'helper', array('my_prop'), true);
-print implode(',', array_keys(get_object_vars($obj2)))."\n";
-?>
---EXPECT--
-I'm alive!
-simple_prop,my_prop,our_prop
-I'm alive!
-simple_prop,your_prop,our_prop
+++ /dev/null
---TEST--
-aggregating default properties matching regular expression
---SKIPIF--
-<?php if (!function_exists('aggregate_properties_by_regexp')) print "skip"; ?>
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate_properties_by_regexp($obj, 'helper', '/^my/');
-print implode(',', array_keys(get_object_vars($obj)))."\n";
-$obj2 = new simple();
-aggregate_properties_by_regexp($obj2, 'helper', '/^my/', true);
-print implode(',', array_keys(get_object_vars($obj2)))."\n";
-?>
---EXPECT--
-I'm alive!
-simple_prop,my_prop
-I'm alive!
-simple_prop,your_prop,our_prop
+++ /dev/null
---TEST--
-retrieving aggregation info
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate($obj, 'mixin');
-print_r(aggregation_info($obj));
-?>
---EXPECT--
-I'm alive!
-Array
-(
- [mixin] => Array
- (
- [methods] => Array
- (
- [0] => mix_it
- )
-
- [properties] => Array
- (
- [0] => mix
- )
-
- )
-
-)
+++ /dev/null
---TEST--
-deaggreating
---POST--
---GET--
---FILE--
-<?php
-include "ext/standard/tests/aggregation/aggregate.lib";
-
-$obj = new simple();
-aggregate($obj, 'helper');
-aggregate($obj, 'mixin');
-print_r(aggregation_info($obj));
-deaggregate($obj, 'helper');
-print_r(aggregation_info($obj));
-deaggregate($obj);
-var_dump(aggregation_info($obj));
-?>
---EXPECT--
-I'm alive!
-Array
-(
- [helper] => Array
- (
- [methods] => Array
- (
- [0] => do_this
- [1] => do_that
- [2] => just_another_method
- )
-
- [properties] => Array
- (
- [0] => my_prop
- [1] => your_prop
- [2] => our_prop
- )
-
- )
-
- [mixin] => Array
- (
- [methods] => Array
- (
- [0] => mix_it
- )
-
- [properties] => Array
- (
- [0] => mix
- )
-
- )
-
-)
-Array
-(
- [mixin] => Array
- (
- [methods] => Array
- (
- [0] => mix_it
- )
-
- [properties] => Array
- (
- [0] => mix
- )
-
- )
-
-)
-bool(false)