Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
/ zynga-hhvm-phpunit Public archive

HHVM support for the PHP Unit Testing framework

License

Notifications You must be signed in to change notification settings

zynga/zynga-hhvm-phpunit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zynga-hhvm-phpunit

Changes from vanilla phpunit here:

  1. hhvm code coverage: The default coverage provided by the combo of phpunit and hhvm doesn't handle the hhvm changes well.
  2. some path scanning functionality doesn't scale well with as large of a codebase we have, so some small tweaks on number of file scans and parses of code were done.
  3. We utilize strict hhvm tests, made a change to TestSuite.php to support running non-static doBeforeClassSetup and doAfterClassSetup function instead of mixing modes between strict and non-strict code.
  4. Fixed: Multiline use statements showing up as uncovered.
  5. New: Added support for enums spanning multiple lines.
  6. Converted all of php-token-stream to be hack strict.
  7. Moved 'most' of php-code-coverage into hack, some strict, some not.
  8. Rewrote a significant portion of how the code coverage stack is handled in order to lower memory footprint and not pass around the line status stack constantly.
  9. Made the code view use solarized dark as the default for viewing code.
  10. Extracted more of the html from the render to the template structure.
  11. Collapsed all of the HHVM driver code to be within the "HHVM" driver, in preparation for supporting the newer debuggers available.
  12. Changed ordering of classes, functions, lines to be consistent throughout the UI.
  13. Removed / reduced the usage of TextTemplate usage within the html template, as we have a very large code base the amount of str_replace overhead catches up with you.
  14. Removed the file require|inclusion within code coverage. This lead to older php code being blind executed. Also hid some of the performance issues around loading of certain legacy libraries.
  15. Migrated PHP_Util_XML to Zynga\PHPUnit\V2\Environment\XML
  16. Migrated PHP_Util_String to Zynga\PHPUnit\V2\Environment\Strings
  17. @covers is removed.

Atributes

Starting with 2.x release track attributes are used instead of the older @foo docblocks.

Crib sheet:

  1. @dataProvider becomes <<dataProvider("..")>>
  2. @requires becomes: <<requires("..")>>
  3. @expectedException becomes: <expectedException("..")>>
  4. @expectedExceptionMessage becomes: <<expectedExceptionMessage("..")>>
  5. @expectedExceptionCode becomes: <<expectedExceptionCode("..")>>

Removed:

  1. @testWith - use @dataProvider so we can keep type saftey.

What if I need to specify multiple of the same attribute, use an array:

  1. <<requires(["foo", "bar"])>>

TODO

  1. SebastianBergmann\TokenStream\Token\StreamMethodStructure->methodSignature isn't working correctly, needs fixing. Might be only multi-line function signatures that are broken - TBD.
  2. PHP_Token_Function: Needs a verification that it handles marking a multi-line abstract function definition as non-executable.
  3. LineToTokens should be moved into stream functionality.
  4. Need to repair the dashboard functionality, as it's fully broken right now.
  5. Performance profiling for the report generation needs to continue.

History

The core developer has opened tickets with the HHVM team wanting for fixes to behave like php. It's unlikely the HHVM team will change to support the same functionality as they have added a improvement to XDebug showing you the number of times that a pieces of code is executed.