]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/PHPUnit/Framework/TestSuite.php
Added unit tests.
[Github/sugarcrm.git] / tests / PHPUnit / Framework / TestSuite.php
1 <?php
2 /**
3  * PHPUnit
4  *
5  * Copyright (c) 2002-2009, Sebastian Bergmann <sb@sebastian-bergmann.de>.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  *   * Redistributions of source code must retain the above copyright
13  *     notice, this list of conditions and the following disclaimer.
14  *
15  *   * Redistributions in binary form must reproduce the above copyright
16  *     notice, this list of conditions and the following disclaimer in
17  *     the documentation and/or other materials provided with the
18  *     distribution.
19  *
20  *   * Neither the name of Sebastian Bergmann nor the names of his
21  *     contributors may be used to endorse or promote products derived
22  *     from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  * @category   Testing
38  * @package    PHPUnit
39  * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
40  * @copyright  2002-2009 Sebastian Bergmann <sb@sebastian-bergmann.de>
41  * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
42
43  * @link       http://www.phpunit.de/
44  * @since      File available since Release 2.0.0
45  */
46
47 require_once 'PHPUnit/Framework.php';
48 require_once 'PHPUnit/Runner/BaseTestRunner.php';
49 require_once 'PHPUnit/Util/Class.php';
50 require_once 'PHPUnit/Util/Fileloader.php';
51 require_once 'PHPUnit/Util/Filter.php';
52 require_once 'PHPUnit/Util/Test.php';
53 require_once 'PHPUnit/Util/TestSuiteIterator.php';
54
55 PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');
56
57 if (!class_exists('PHPUnit_Framework_TestSuite', FALSE)) {
58
59 /**
60  * A TestSuite is a composite of Tests. It runs a collection of test cases.
61  *
62  * Here is an example using the dynamic test definition.
63  *
64  * <code>
65  * <?php
66  * $suite = new PHPUnit_Framework_TestSuite;
67  * $suite->addTest(new MathTest('testPass'));
68  * ?>
69  * </code>
70  *
71  * Alternatively, a TestSuite can extract the tests to be run automatically.
72  * To do so you pass a ReflectionClass instance for your
73  * PHPUnit_Framework_TestCase class to the PHPUnit_Framework_TestSuite
74  * constructor.
75  *
76  * <code>
77  * <?php
78  * $suite = new PHPUnit_Framework_TestSuite(
79  *   new ReflectionClass('MathTest')
80  * );
81  * ?>
82  * </code>
83  *
84  * This constructor creates a suite with all the methods starting with
85  * "test" that take no arguments.
86  *
87  * @category   Testing
88  * @package    PHPUnit
89  * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
90  * @copyright  2002-2009 Sebastian Bergmann <sb@sebastian-bergmann.de>
91  * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
92  * @version    Release: 3.3.17
93  * @link       http://www.phpunit.de/
94  * @since      Class available since Release 2.0.0
95  */
96 class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Framework_SelfDescribing, IteratorAggregate
97 {
98     /**
99      * Enable or disable the backup and restoration of the $GLOBALS array.
100      *
101      * @var    boolean
102      */
103     protected $backupGlobals = NULL;
104
105     /**
106      * Fixture that is shared between the tests of this test suite.
107      *
108      * @var    mixed
109      */
110     protected $sharedFixture;
111
112     /**
113      * The name of the test suite.
114      *
115      * @var    string
116      */
117     protected $name = '';
118
119     /**
120      * The test groups of the test suite.
121      *
122      * @var    array
123      */
124     protected $groups = array();
125
126     /**
127      * The tests in the test suite.
128      *
129      * @var    array
130      */
131     protected $tests = array();
132
133     /**
134      * The number of tests in the test suite.
135      *
136      * @var    integer
137      */
138     protected $numTests = -1;
139
140     /**
141      * Constructs a new TestSuite:
142      *
143      *   - PHPUnit_Framework_TestSuite() constructs an empty TestSuite.
144      *
145      *   - PHPUnit_Framework_TestSuite(ReflectionClass) constructs a
146      *     TestSuite from the given class.
147      *
148      *   - PHPUnit_Framework_TestSuite(ReflectionClass, String)
149      *     constructs a TestSuite from the given class with the given
150      *     name.
151      *
152      *   - PHPUnit_Framework_TestSuite(String) either constructs a
153      *     TestSuite from the given class (if the passed string is the
154      *     name of an existing class) or constructs an empty TestSuite
155      *     with the given name.
156      *
157      * @param  mixed  $theClass
158      * @param  string $name
159      * @throws InvalidArgumentException
160      */
161     public function __construct($theClass = '', $name = '')
162     {
163         $argumentsValid = FALSE;
164
165         if (is_object($theClass) &&
166             $theClass instanceof ReflectionClass) {
167             $argumentsValid = TRUE;
168         }
169
170         else if (is_string($theClass) && $theClass !== ''
171                  && class_exists($theClass, FALSE)) {
172             $argumentsValid = TRUE;
173
174             if ($name == '') {
175                 $name = $theClass;
176             }
177
178             $theClass = new ReflectionClass($theClass);
179         }
180
181         else if (is_string($theClass)) {
182             $this->setName($theClass);
183             return;
184         }
185
186         if (!$argumentsValid) {
187             throw new InvalidArgumentException;
188         }
189
190         $filename = $theClass->getFilename();
191
192         if (strpos($filename, 'eval()') === FALSE) {
193             PHPUnit_Util_Filter::addFileToFilter(realpath($filename), 'TESTS');
194         }
195
196         if ($name != '') {
197             $this->setName($name);
198         } else {
199             $this->setName($theClass->getName());
200         }
201
202         $constructor = $theClass->getConstructor();
203
204         if ($constructor !== NULL &&
205             !$constructor->isPublic()) {
206             $this->addTest(
207               self::warning(
208                 sprintf(
209                   'Class "%s" has no public constructor.',
210
211                   $theClass->getName()
212                 )
213               )
214             );
215
216             return;
217         }
218
219         $className       = $theClass->getName();
220         $classDocComment = $theClass->getDocComment();
221         $names           = array();
222         $classGroups     = PHPUnit_Util_Test::getGroups($classDocComment);
223
224         foreach ($theClass->getMethods() as $method) {
225             if (strpos($method->getDeclaringClass()->getName(), 'PHPUnit_') !== 0) {
226                 $methodDocComment = $method->getDocComment();
227
228                 $this->addTestMethod(
229                   $theClass,
230                   $method,
231                   PHPUnit_Util_Test::getGroups($methodDocComment, $classGroups),
232                   $names
233                 );
234             }
235         }
236
237         if (empty($this->tests)) {
238             $this->addTest(
239               self::warning(
240                 sprintf(
241                   'No tests found in class "%s".',
242
243                   $theClass->getName()
244                 )
245               )
246             );
247         }
248     }
249
250     /**
251      * Returns a string representation of the test suite.
252      *
253      * @return string
254      */
255     public function toString()
256     {
257         return $this->getName();
258     }
259
260     /**
261      * Adds a test to the suite.
262      *
263      * @param  PHPUnit_Framework_Test $test
264      * @param  array                  $groups
265      */
266     public function addTest(PHPUnit_Framework_Test $test, $groups = array())
267     {
268         $class = new ReflectionClass($test);
269
270         if (!$class->isAbstract()) {
271             $this->tests[]  = $test;
272             $this->numTests = -1;
273
274             if ($test instanceof PHPUnit_Framework_TestSuite && empty($groups)) {
275                 $groups = $test->getGroups();
276             }
277
278             if (empty($groups)) {
279                 $groups = array('__nogroup__');
280             }
281
282             foreach ($groups as $group) {
283                 if (!isset($this->groups[$group])) {
284                     $this->groups[$group] = array($test);
285                 } else {
286                     $this->groups[$group][] = $test;
287                 }
288             }
289         }
290     }
291
292     /**
293      * Adds the tests from the given class to the suite.
294      *
295      * @param  mixed $testClass
296      * @throws InvalidArgumentException
297      */
298     public function addTestSuite($testClass)
299     {
300         if (is_string($testClass) && class_exists($testClass)) {
301             $testClass = new ReflectionClass($testClass);
302         }
303
304         if (!is_object($testClass)) {
305             throw new InvalidArgumentException;
306         }
307
308         if ($testClass instanceof PHPUnit_Framework_TestSuite) {
309             $this->addTest($testClass);
310         }
311
312         else if ($testClass instanceof ReflectionClass) {
313             $suiteMethod = FALSE;
314
315             if (!$testClass->isAbstract()) {
316                 if ($testClass->hasMethod(PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME)) {
317                     $method = $testClass->getMethod(
318                       PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME
319                     );
320
321                     if ($method->isStatic()) {
322                         $this->addTest($method->invoke(NULL, $testClass->getName()));
323                         $suiteMethod = TRUE;
324                     }
325                 }
326             }
327
328             if (!$suiteMethod && !$testClass->isAbstract()) {
329                 $this->addTest(new PHPUnit_Framework_TestSuite($testClass));
330             }
331         }
332
333         else {
334             throw new InvalidArgumentException;
335         }
336     }
337
338     /**
339      * Wraps both <code>addTest()</code> and <code>addTestSuite</code>
340      * as well as the separate import statements for the user's convenience.
341      *
342      * If the named file cannot be read or there are no new tests that can be
343      * added, a <code>PHPUnit_Framework_Warning</code> will be created instead,
344      * leaving the current test run untouched.
345      *
346      * @param  string  $filename
347      * @param  boolean $syntaxCheck
348      * @param  array   $phptOptions Array with ini settings for the php instance
349      *                              run, key being the name if the setting,
350      *                              value the ini value.
351      * @throws InvalidArgumentException
352      * @since  Method available since Release 2.3.0
353      * @author Stefano F. Rausch <stefano@rausch-e.net>
354      */
355     public function addTestFile($filename, $syntaxCheck = TRUE, $phptOptions = array())
356     {
357         if (!is_string($filename)) {
358             throw new InvalidArgumentException;
359         }
360
361         if (file_exists($filename) && substr($filename, -5) == '.phpt') {
362             require_once 'PHPUnit/Extensions/PhptTestCase.php';
363
364             $this->addTest(
365               new PHPUnit_Extensions_PhptTestCase($filename, $phptOptions)
366             );
367
368             return;
369         }
370
371         if (!file_exists($filename)) {
372             $includePaths = explode(PATH_SEPARATOR, get_include_path());
373
374             foreach ($includePaths as $includePath) {
375                 $file = $includePath . DIRECTORY_SEPARATOR . $filename;
376
377                 if (file_exists($file)) {
378                     $filename = $file;
379                     break;
380                 }
381             }
382         }
383
384         PHPUnit_Util_Class::collectStart();
385         PHPUnit_Util_Fileloader::checkAndLoad($filename, $syntaxCheck);
386         $newClasses = PHPUnit_Util_Class::collectEnd();
387
388         $testsFound = FALSE;
389
390         foreach ($newClasses as $className) {
391             $class = new ReflectionClass($className);
392
393             if (!$class->isAbstract()) {
394                 if ($class->hasMethod(PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME)) {
395                     $method = $class->getMethod(
396                       PHPUnit_Runner_BaseTestRunner::SUITE_METHODNAME
397                     );
398
399                     if ($method->isStatic()) {
400                         $this->addTest($method->invoke(NULL, $className));
401
402                         $testsFound = TRUE;
403                     }
404                 }
405
406                 else if ($class->implementsInterface('PHPUnit_Framework_Test')) {
407                     $this->addTestSuite($class);
408
409                     $testsFound = TRUE;
410                 }
411             }
412         }
413
414         if (!$testsFound) {
415             $this->addTest(
416               new PHPUnit_Framework_Warning(
417                 'No tests found in file "' . $filename . '".'
418               )
419             );
420         }
421
422         $this->numTests = -1;
423     }
424
425     /**
426      * Wrapper for addTestFile() that adds multiple test files.
427      *
428      * @param  array|Iterator $filenames
429      * @throws InvalidArgumentException
430      * @since  Method available since Release 2.3.0
431      */
432     public function addTestFiles($filenames, $syntaxCheck = TRUE)
433     {
434         if (!(is_array($filenames) ||
435              (is_object($filenames) && $filenames instanceof Iterator))) {
436             throw new InvalidArgumentException;
437         }
438
439         foreach ($filenames as $filename) {
440             $this->addTestFile((string)$filename, $syntaxCheck);
441         }
442     }
443
444     /**
445      * Counts the number of test cases that will be run by this test.
446      *
447      * @return integer
448      */
449     public function count()
450     {
451         if ($this->numTests > -1) {
452             return $this->numTests;
453         }
454
455         $this->numTests = 0;
456
457         foreach ($this->tests as $test) {
458             $this->numTests += count($test);
459         }
460
461         return $this->numTests;
462     }
463
464     /**
465      * @param  ReflectionClass $theClass
466      * @param  string          $name
467      * @param  array           $classGroups
468      * @return PHPUnit_Framework_Test
469      */
470     public static function createTest(ReflectionClass $theClass, $name, array $classGroups = array())
471     {
472         $className        = $theClass->getName();
473         $method           = new ReflectionMethod($className, $name);
474         $methodDocComment = $method->getDocComment();
475
476         if (!$theClass->isInstantiable()) {
477             return self::warning(
478               sprintf('Cannot instantiate class "%s".', $className)
479             );
480         }
481
482         $constructor       = $theClass->getConstructor();
483         $expectedException = PHPUnit_Util_Test::getExpectedException($methodDocComment);
484
485         if ($constructor !== NULL) {
486             $parameters = $constructor->getParameters();
487
488             // TestCase() or TestCase($name)
489             if (count($parameters) < 2) {
490                 $test = new $className;
491             }
492
493             // TestCase($name, $data)
494             else {
495                 $data   = PHPUnit_Util_Test::getProvidedData($className, $name, $methodDocComment);
496                 $groups = PHPUnit_Util_Test::getGroups($methodDocComment, $classGroups);
497
498                 if (is_array($data) || $data instanceof Iterator) {
499                     $test = new PHPUnit_Framework_TestSuite(
500                       $className . '::' . $name
501                     );
502
503                     foreach ($data as $_dataName => $_data) {
504                         $_test = new $className($name, $_data, $_dataName);
505
506                         if ($_test instanceof PHPUnit_Framework_TestCase &&
507                             isset($expectedException)) {
508                             $_test->setExpectedException(
509                               $expectedException['class'],
510                               $expectedException['message'],
511                               $expectedException['code']
512                             );
513                         }
514
515                         $test->addTest($_test, $groups);
516                     }
517                 } else {
518                     $test = new $className;
519                 }
520             }
521         }
522
523         if ($test instanceof PHPUnit_Framework_TestCase) {
524             $test->setName($name);
525
526             if (isset($expectedException)) {
527                 $test->setExpectedException(
528                   $expectedException['class'],
529                   $expectedException['message'],
530                   $expectedException['code']
531                 );
532             }
533         }
534
535         return $test;
536     }
537
538     /**
539      * Creates a default TestResult object.
540      *
541      * @return PHPUnit_Framework_TestResult
542      */
543     protected function createResult()
544     {
545         return new PHPUnit_Framework_TestResult;
546     }
547
548     /**
549      * Returns the name of the suite.
550      *
551      * @return string
552      */
553     public function getName()
554     {
555         return $this->name;
556     }
557
558     /**
559      * Returns the test groups of the suite.
560      *
561      * @return array
562      * @since  Method available since Release 3.2.0
563      */
564     public function getGroups()
565     {
566         return array_keys($this->groups);
567     }
568
569     /**
570      * Runs the tests and collects their result in a TestResult.
571      *
572      * @param  PHPUnit_Framework_TestResult $result
573      * @param  mixed                        $filter
574      * @param  array                        $groups
575      * @param  array                        $excludeGroups
576      * @return PHPUnit_Framework_TestResult
577      * @throws InvalidArgumentException
578      */
579     public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE, array $groups = array(), array $excludeGroups = array())
580     {
581         if ($result === NULL) {
582             $result = $this->createResult();
583         }
584
585         try {
586             $this->setUp();
587         }
588
589         catch (PHPUnit_Framework_SkippedTestSuiteError $e) {
590             $numTests = count($this);
591
592             for ($i = 0; $i < $numTests; $i++) {
593                 $result->addFailure($this, $e, 0);
594             }
595
596             return $result;
597         }
598
599         $result->startTestSuite($this);
600
601         if (empty($groups)) {
602             $tests = $this->tests;
603         } else {
604             $tests = new SplObjectStorage;
605
606             foreach ($groups as $group) {
607                 if (isset($this->groups[$group])) {
608                     foreach ($this->groups[$group] as $test) {
609                         $tests->attach($test);
610                     }
611                 }
612             }
613         }
614
615         foreach ($tests as $test) {
616             if ($result->shouldStop()) {
617                 break;
618             }
619
620             if ($test instanceof PHPUnit_Framework_TestSuite) {
621                 $test->setBackupGlobals($this->backupGlobals);
622                 $test->setSharedFixture($this->sharedFixture);
623                 $test->run($result, $filter, $groups, $excludeGroups);
624             } else {
625                 $runTest = TRUE;
626
627                 if ($filter !== FALSE ) {
628                     $tmp = PHPUnit_Util_Test::describe($test, FALSE);
629
630                     if ($tmp[0] != '') {
631                         $name = join('::', $tmp);
632                     } else {
633                         $name = $tmp[1];
634                     }
635
636                     if (preg_match($filter, $name) == 0) {
637                         $runTest = FALSE;
638                     }
639                 }
640
641                 if ($runTest && !empty($excludeGroups)) {
642                     foreach ($this->groups as $_group => $_tests) {
643                         if (in_array($_group, $excludeGroups)) {
644                             foreach ($_tests as $_test) {
645                                 if ($test === $_test) {
646                                     $runTest = FALSE;
647                                     break 2;
648                                 }
649                             }
650                         }
651                     }
652                 }
653
654                 if ($runTest) {
655                     if ($test instanceof PHPUnit_Framework_TestCase) {
656                         $test->setBackupGlobals($this->backupGlobals);
657                         $test->setSharedFixture($this->sharedFixture);
658                     }
659
660                     $this->runTest($test, $result);
661                 }
662             }
663         }
664
665         $result->endTestSuite($this);
666         $this->tearDown();
667
668         return $result;
669     }
670
671     /**
672      * Runs a test.
673      *
674      * @param  PHPUnit_Framework_Test        $test
675      * @param  PHPUnit_Framework_TestResult  $testResult
676      */
677     public function runTest(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)
678     {
679         $test->run($result);
680     }
681
682     /**
683      * Sets the name of the suite.
684      *
685      * @param  string
686      */
687     public function setName($name)
688     {
689         $this->name = $name;
690     }
691
692     /**
693      * Returns the test at the given index.
694      *
695      * @param  integer
696      * @return PHPUnit_Framework_Test
697      */
698     public function testAt($index)
699     {
700         if (isset($this->tests[$index])) {
701             return $this->tests[$index];
702         } else {
703             return FALSE;
704         }
705     }
706
707     /**
708      * Returns the tests as an enumeration.
709      *
710      * @return array
711      */
712     public function tests()
713     {
714         return $this->tests;
715     }
716
717     /**
718      * Mark the test suite as skipped.
719      *
720      * @param  string  $message
721      * @throws PHPUnit_Framework_SkippedTestSuiteError
722      * @since  Method available since Release 3.0.0
723      */
724     public function markTestSuiteSkipped($message = '')
725     {
726         throw new PHPUnit_Framework_SkippedTestSuiteError($message);
727     }
728
729     /**
730      * @param  ReflectionClass  $class
731      * @param  ReflectionMethod $method
732      * @param  string           $groups
733      * @param  array            $names
734      */
735     protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method, array $groups, array &$names)
736     {
737         $name = $method->getName();
738
739         if (in_array($name, $names)) {
740             return;
741         }
742
743         if ($this->isPublicTestMethod($method)) {
744             $names[] = $name;
745
746             $test = self::createTest($class, $name, $groups);
747
748             $this->addTest($test, $groups);
749         }
750
751         else if ($this->isTestMethod($method)) {
752             $this->addTest(
753               self::warning(
754                 sprintf(
755                   'Test method "%s" is not public.',
756
757                   $name
758                 )
759               )
760             );
761         }
762     }
763
764     /**
765      * @param  ReflectionMethod $method
766      * @return boolean
767      */
768     public static function isPublicTestMethod(ReflectionMethod $method)
769     {
770         return (self::isTestMethod($method) && $method->isPublic());
771     }
772
773     /**
774      * @param  ReflectionMethod $method
775      * @return boolean
776      */
777     public static function isTestMethod(ReflectionMethod $method)
778     {
779         if (strpos($method->name, 'test') === 0) {
780             return TRUE;
781         }
782
783         // @scenario on TestCase::testMethod()
784         // @test     on TestCase::testMethod()
785         return strpos($method->getDocComment(), '@test')     !== FALSE ||
786                strpos($method->getDocComment(), '@scenario') !== FALSE;
787     }
788
789     /**
790      * @param  string  $message
791      * @return PHPUnit_Framework_Warning
792      */
793     protected static function warning($message)
794     {
795         return new PHPUnit_Framework_Warning($message);
796     }
797
798     /**
799      * @param  boolean $backupGlobals
800      * @since  Method available since Release 3.3.0
801      */
802     public function setBackupGlobals($backupGlobals)
803     {
804         if (is_null($this->backupGlobals) && is_bool($backupGlobals)) {
805             $this->backupGlobals = $backupGlobals;
806         }
807     }
808
809     /**
810      * Sets the shared fixture for the tests of this test suite.
811      *
812      * @param  mixed $sharedFixture
813      * @since  Method available since Release 3.1.0
814      */
815     public function setSharedFixture($sharedFixture)
816     {
817         $this->sharedFixture = $sharedFixture;
818     }
819
820     /**
821      * Returns an iterator for this test suite.
822      *
823      * @return RecursiveIteratorIterator
824      * @since  Method available since Release 3.1.0
825      */
826     public function getIterator()
827     {
828         return new RecursiveIteratorIterator(
829           new PHPUnit_Util_TestSuiteIterator($this)
830         );
831     }
832
833     /**
834      * Template Method that is called before the tests
835      * of this test suite are run.
836      *
837      * @since  Method available since Release 3.1.0
838      */
839     protected function setUp()
840     {
841     }
842
843     /**
844      * Template Method that is called after the tests
845      * of this test suite have finished running.
846      *
847      * @since  Method available since Release 3.1.0
848      */
849     protected function tearDown()
850     {
851     }
852 }
853
854 }
855 ?>