WordPress.org

Make WordPress Core

Changeset 35226


Ignore:
Timestamp:
10/16/2015 09:14:52 PM (6 years ago)
Author:
wonderboymusic
Message:

Unit Tests: PHP 5.2, I Hate You and You Are Bringing Me Down.

#YOLOFriday

See #30017, #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/speed-trap-listener.php

    r35214 r35226  
    55 * results directly to the console.
    66 */
    7 class SpeedTrapListener implements \PHPUnit_Framework_TestListener
     7class SpeedTrapListener implements PHPUnit_Framework_TestListener
    88{
    99    /**
     
    5252     * An error occurred.
    5353     *
    54      * @param \PHPUnit_Framework_Test $test
    55      * @param \Exception              $e
    56      * @param float                   $time
    57      */
    58     public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
     54     * @param PHPUnit_Framework_Test $test
     55     * @param Exception              $e
     56     * @param float                   $time
     57     */
     58    public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
    5959    {
    6060    }
     
    6363     * A failure occurred.
    6464     *
    65      * @param \PHPUnit_Framework_Test                 $test
    66      * @param \PHPUnit_Framework_AssertionFailedError $e
     65     * @param PHPUnit_Framework_Test                 $test
     66     * @param PHPUnit_Framework_AssertionFailedError $e
    6767     * @param float                                   $time
    6868     */
    69     public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time)
     69    public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
    7070    {
    7171    }
     
    7474     * Incomplete test.
    7575     *
    76      * @param \PHPUnit_Framework_Test $test
    77      * @param \Exception              $e
    78      * @param float                   $time
    79      */
    80     public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
     76     * @param PHPUnit_Framework_Test $test
     77     * @param Exception              $e
     78     * @param float                   $time
     79     */
     80    public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time)
    8181    {
    8282    }
     
    8585     * Risky test.
    8686     *
    87      * @param \PHPUnit_Framework_Test $test
    88      * @param \Exception              $e
     87     * @param PHPUnit_Framework_Test $test
     88     * @param Exception              $e
    8989     * @param float                   $time
    9090     * @since  Method available since Release 4.0.0
    9191     */
    92     public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
     92    public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time)
    9393    {
    9494    }
     
    9797     * Skipped test.
    9898     *
    99      * @param \PHPUnit_Framework_Test $test
    100      * @param \Exception              $e
    101      * @param float                   $time
    102      */
    103     public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
     99     * @param PHPUnit_Framework_Test $test
     100     * @param Exception              $e
     101     * @param float                   $time
     102     */
     103    public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)
    104104    {
    105105    }
     
    108108     * A test started.
    109109     *
    110      * @param \PHPUnit_Framework_Test $test
    111      */
    112     public function startTest(\PHPUnit_Framework_Test $test)
     110     * @param PHPUnit_Framework_Test $test
     111     */
     112    public function startTest(PHPUnit_Framework_Test $test)
    113113    {
    114114    }
     
    117117     * A test ended.
    118118     *
    119      * @param \PHPUnit_Framework_Test $test
    120      * @param float                   $time
    121      */
    122     public function endTest(\PHPUnit_Framework_Test $test, $time)
    123     {
    124         if (!$test instanceof \PHPUnit_Framework_TestCase) return;
     119     * @param PHPUnit_Framework_Test $test
     120     * @param float                   $time
     121     */
     122    public function endTest(PHPUnit_Framework_Test $test, $time)
     123    {
     124        if (!$test instanceof PHPUnit_Framework_TestCase) return;
    125125
    126126        $time = $this->toMilliseconds($time);
     
    135135     * A test suite started.
    136136     *
    137      * @param \PHPUnit_Framework_TestSuite $suite
    138      */
    139     public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
     137     * @param PHPUnit_Framework_TestSuite $suite
     138     */
     139    public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
    140140    {
    141141        $this->suites++;
     
    145145     * A test suite ended.
    146146     *
    147      * @param \PHPUnit_Framework_TestSuite $suite
    148      */
    149     public function endTestSuite(\PHPUnit_Framework_TestSuite $suite)
     147     * @param PHPUnit_Framework_TestSuite $suite
     148     */
     149    public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
    150150    {
    151151        $this->suites--;
     
    175175     * Stores a test as slow.
    176176     *
    177      * @param \PHPUnit_Framework_TestCase $test
     177     * @param PHPUnit_Framework_TestCase $test
    178178     * @param int                         $time Test execution time in milliseconds
    179179     */
    180     protected function addSlowTest(\PHPUnit_Framework_TestCase $test, $time)
     180    protected function addSlowTest(PHPUnit_Framework_TestCase $test, $time)
    181181    {
    182182        $label = $this->makeLabel($test);
     
    209209     * Label for describing a test.
    210210     *
    211      * @param \PHPUnit_Framework_TestCase $test
     211     * @param PHPUnit_Framework_TestCase $test
    212212     * @return string
    213213     */
    214     protected function makeLabel(\PHPUnit_Framework_TestCase $test)
     214    protected function makeLabel(PHPUnit_Framework_TestCase $test)
    215215    {
    216216        return sprintf('%s:%s', get_class($test), $test->getName());
     
    299299     *
    300300     * <code>
    301      * \@slowThreshold 5000
     301     * @slowThreshold 5000
    302302     * public function testLongRunningProcess() {}
    303303     * </code>
    304304     *
    305      * @param \PHPUnit_Framework_TestCase $test
     305     * @param PHPUnit_Framework_TestCase $test
    306306     * @return int
    307307     */
    308     protected function getSlowThreshold(\PHPUnit_Framework_TestCase $test)
     308    protected function getSlowThreshold(PHPUnit_Framework_TestCase $test)
    309309    {
    310310        $ann = $test->getAnnotations();
Note: See TracChangeset for help on using the changeset viewer.