add myCalendar into
[awl.git] / vendor / phpunit / phpunit-mock-objects / Tests / MockObject / class_dont_call_parent_clone.phpt
blob5d337bc421bb68459ee0b74cdcb88114acbf2a19
1 --TEST--
2 PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', FALSE)
3 --FILE--
4 <?php
5 class Foo
7     public function __clone()
8     {
9     }
12 require_once 'PHPUnit/Autoload.php';
13 require_once 'Text/Template.php';
15 $mock = PHPUnit_Framework_MockObject_Generator::generate(
16   'Foo',
17   array(),
18   'MockFoo',
19   FALSE
22 print $mock['code'];
24 --EXPECTF--
25 class MockFoo extends Foo implements PHPUnit_Framework_MockObject_MockObject
27     private static $__phpunit_staticInvocationMocker;
28     private $__phpunit_invocationMocker;
30     public function __clone()
31     {
32         $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
33     }
35     public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
36     {
37         return $this->__phpunit_getInvocationMocker()->expects($matcher);
38     }
40     public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
41     {
42         return self::__phpunit_getStaticInvocationMocker()->expects($matcher);
43     }
45     public function __phpunit_getInvocationMocker()
46     {
47         if ($this->__phpunit_invocationMocker === NULL) {
48             $this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
49         }
51         return $this->__phpunit_invocationMocker;
52     }
54     public static function __phpunit_getStaticInvocationMocker()
55     {
56         if (self::$__phpunit_staticInvocationMocker === NULL) {
57             self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
58         }
60         return self::$__phpunit_staticInvocationMocker;
61     }
63     public function __phpunit_hasMatchers()
64     {
65         return self::__phpunit_getStaticInvocationMocker()->hasMatchers() ||
66                $this->__phpunit_getInvocationMocker()->hasMatchers();
67     }
69     public function __phpunit_verify()
70     {
71         self::__phpunit_getStaticInvocationMocker()->verify();
72         $this->__phpunit_getInvocationMocker()->verify();
73     }
75     public function __phpunit_cleanup()
76     {
77         self::$__phpunit_staticInvocationMocker = NULL;
78         $this->__phpunit_invocationMocker       = NULL;
79     }