Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@backupStaticAttributes does not work for php 5.3.26 #961

Closed
renanbr opened this issue Jul 12, 2013 · 3 comments
Closed

@backupStaticAttributes does not work for php 5.3.26 #961

renanbr opened this issue Jul 12, 2013 · 3 comments

Comments

@renanbr
Copy link

renanbr commented Jul 12, 2013

I've tried run a test using @backupStaticAttributes feature, documentation says it requires 5.3 or greater.

I didn't explore much this potential bug, but I have an example, when Travis runs tests in https://github.com/renanbr/telltale

Context

Test case: https://github.com/renanbr/telltale/blob/880b27d2c3e87c668eb9854ed9964717bd9836fe/tests/TelltaleTest/TelltaleTest.php#L17

Target class attribute: https://github.com/renanbr/telltale/blob/880b27d2c3e87c668eb9854ed9964717bd9836fe/src/Telltale/Telltale.php#L23

Results

5.5.0 -> ok
5.4.16 -> ok
5.3.26 -> FAIL

@sebastianbergmann
Copy link
Owner

I cannot reproduce this:

➜  ~  git clone [email protected]:renanbr/telltale.git
Cloning into 'telltale'...
remote: Counting objects: 281, done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 281 (delta 97), reused 260 (delta 77)
Receiving objects: 100% (281/281), 394.17 KiB | 308.00 KiB/s, done.
Resolving deltas: 100% (97/97), done.


➜  ~  cd telltale 


➜  telltale git:(master) wget http://getcomposer.org/composer.phar
--2013-07-29 15:07:00--  http://getcomposer.org/composer.phar
Resolving getcomposer.org (getcomposer.org)... 87.98.253.108
Connecting to getcomposer.org (getcomposer.org)|87.98.253.108|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 876247 (856K) [application/octet-stream]
Saving to: ‘composer.phar’

100%[============================================================================>] 876,247      694KB/s   in 1.2s   

2013-07-29 15:07:01 (694 KB/s) - ‘composer.phar’ saved [876247/876247]


➜  telltale git:(master) ✗ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing monolog/monolog (1.5.0)
    Loading from cache

monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
Generating autoload files


➜  telltale git:(master) ✗ /usr/local/php-5.3.26/bin/php -v                                
PHP 5.3.26 (cli) (built: Jul 29 2013 15:02:26) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.3.0dev, Copyright (c) 2002-2013, by Derick Rethans


➜  telltale git:(master) ✗ /usr/local/php-5.3.26/bin/php /usr/local/src/phpunit/phpunit.php
PHPUnit 3.7.22 by Sebastian Bergmann.

Configuration read from /home/sb/telltale/phpunit.xml

........................................................

Time: 1 second, Memory: 10.75Mb

OK (56 tests, 74 assertions)

@renanbr
Copy link
Author

renanbr commented Jul 30, 2013

@sebastianbergmann I've done a commit that resets static attribute by my hand. Tests work for current telltale master revision. But it's possible reproduce error if you reset to a specific revision.

$ git reset --hard 880b27d2c3e87c668eb9854ed9964717bd9836fe
HEAD is now at 880b27d Create .travis.yml

Sorry for didnt give you a detailed instruction to reproduce it.

Note: It seems that get_declared_classes() in PHPUnit_Util_GlobalState::backupStaticAttributes() does not return Telltale\Telltale (contains a static attribute) at first time. Backup only works after Telltale\Telltale is required first time.

If you can reproduce error, confirm this issue as error and reopen I can ivestigate more.

thanks,


my php version

PHP 5.3.26 (cli) (built: Jun  6 2013 09:45:13) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
    with Zend Extension Manager v6.0.0, Copyright (c) 2003-2013, by Zend Technologies
    - with Zend Data Cache v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [disabled]
    - with Zend Job Queue v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [enabled]
    - with Zend Session Clustering v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [disabled]
    - with Zend Utils v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [enabled]
    - with Zend Optimizer+ v6.0.0, Copyright (c) 1999-2013, by Zend Technologies [loaded] [licensed] [disabled]
    - with Zend Code Tracing v6.0.0, Copyright (c) 2009-2013, by Zend Technologies [loaded] [licensed] [enabled]
    - with Zend Monitor v6.0.0, Copyright (c) 1999-2013, by Zend Technologies [loaded] [licensed] [disabled]
    - with Zend Debugger v6.0.0, Copyright (c) 1999-2013, by Zend Technologies [loaded] [licensed] [enabled]
    - with Zend Page Cache v6.0.0, Copyright (c) 2004-2013, by Zend Technologies [loaded] [licensed] [disabled]

test result, same as travis

PHPUnit 3.7.21 by Sebastian Bergmann.

Configuration read from /opt/telltale/phpunit.xml

.........................F.EE........................

Time: 1 second, Memory: 5.25Mb

There were 2 errors:

1) TelltaleTest\TelltaleTest::testAgentStartTrigger
RuntimeException: There is another Telltale instance running.

/opt/telltale/src/Telltale/Telltale.php:54
/opt/telltale/tests/TelltaleTest/TelltaleTest.php:76

2) TelltaleTest\TelltaleTest::testAgentStopTrigger
RuntimeException: There is another Telltale instance running.

/opt/telltale/src/Telltale/Telltale.php:54
/opt/telltale/tests/TelltaleTest/TelltaleTest.php:93

--


There was 1 failure:

1) TelltaleTest\TelltaleTest::testCanNotStopTwice
Failed asserting that exception message 'There is another Telltale instance running.' contains 'Telltale instance is already stopped.'.

@RichardBradley
Copy link

Duplicate of issue #1 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants