Browse files

Initial commit

  • Loading branch information...
0 parents commit 8b890cb3eaa9e677a11febb7d0a41db22ffd7f19 @benallfree committed Oct 12, 2011
Showing with 43,760 additions and 0 deletions.
  2. +502 −0 LICENSE
  3. +102 −0 README
  4. +1 −0 VERSION
  5. +237 −0 authentication.php
  6. +99 −0 autorun.php
  7. +1,144 −0 browser.php
  8. +122 −0 collector.php
  9. +166 −0 compatibility.php
  10. +380 −0 cookies.php
  11. +163 −0 default_reporter.php
  12. +96 −0 detached.php
  13. +378 −0 docs/en/authentication_documentation.html
  14. +501 −0 docs/en/browser_documentation.html
  15. +121 −0 docs/en/docs.css
  16. +476 −0 docs/en/expectation_documentation.html
  17. +351 −0 docs/en/form_testing_documentation.html
  18. +252 −0 docs/en/group_test_documentation.html
  19. +542 −0 docs/en/index.html
  20. +870 −0 docs/en/mock_objects_documentation.html
  21. +487 −0 docs/en/overview.html
  22. +457 −0 docs/en/partial_mocks_documentation.html
  23. +616 −0 docs/en/reporter_documentation.html
  24. +442 −0 docs/en/unit_test_documentation.html
  25. +588 −0 docs/en/web_tester_documentation.html
  26. +371 −0 docs/fr/authentication_documentation.html
  27. +500 −0 docs/fr/browser_documentation.html
  28. +84 −0 docs/fr/docs.css
  29. +451 −0 docs/fr/expectation_documentation.html
  30. +353 −0 docs/fr/form_testing_documentation.html
  31. +401 −0 docs/fr/group_test_documentation.html
  32. +576 −0 docs/fr/index.html
  33. +784 −0 docs/fr/mock_objects_documentation.html
  34. +321 −0 docs/fr/overview.html
  35. +464 −0 docs/fr/partial_mocks_documentation.html
  36. +538 −0 docs/fr/reporter_documentation.html
  37. +450 −0 docs/fr/unit_test_documentation.html
  38. +570 −0 docs/fr/web_tester_documentation.html
  39. +407 −0 dumper.php
  40. +307 −0 eclipse.php
  41. +649 −0 encoding.php
  42. +267 −0 errors.php
  43. +226 −0 exceptions.php
  44. +984 −0 expectation.php
  45. +196 −0 extensions/pear_test_case.php
  46. +53 −0 extensions/testdox.php
  47. +107 −0 extensions/testdox/test.php
  48. +361 −0 form.php
  49. +592 −0 frames.php
  50. +628 −0 http.php
  51. +139 −0 invoker.php
  52. +1,641 −0 mock_objects.php
  53. +542 −0 page.php
  54. +1,054 −0 php_parser.php
  55. +136 −0 reflection_php4.php
  56. +386 −0 reflection_php5.php
  57. +115 −0 remote.php
  58. +445 −0 reporter.php
  59. +875 −0 scorer.php
  60. +141 −0 selector.php
  61. +330 −0 shell_tester.php
  62. +391 −0 simpletest.php
  63. +312 −0 socket.php
  64. +1,527 −0 tag.php
  65. +1,729 −0 test/acceptance_test.php
  66. +50 −0 test/adapter_test.php
  67. +13 −0 test/all_tests.php
  68. +145 −0 test/authentication_test.php
  69. +23 −0 test/autorun_test.php
  70. +10 −0 test/bad_test_suite.php
  71. +802 −0 test/browser_test.php
  72. +50 −0 test/collector_test.php
  73. +40 −0 test/command_line_test.php
  74. +87 −0 test/compatibility_test.php
  75. +227 −0 test/cookies_test.php
  76. +15 −0 test/detached_test.php
  77. +88 −0 test/dumper_test.php
  78. +32 −0 test/eclipse_test.php
  79. +240 −0 test/encoding_test.php
  80. +229 −0 test/errors_test.php
  81. +183 −0 test/exceptions_test.php
  82. +317 −0 test/expectation_test.php
  83. +344 −0 test/form_test.php
  84. +549 −0 test/frames_test.php
  85. +492 −0 test/http_test.php
  86. +137 −0 test/interfaces_test.php
  87. +14 −0 test/interfaces_test_php5_1.php
  88. +47 −0 test/live_test.php
  89. +985 −0 test/mock_objects_test.php
  90. +166 −0 test/page_test.php
  91. +9 −0 test/parse_error_test.php
  92. +642 −0 test/parsing_test.php
  93. +489 −0 test/php_parser_test.php
  94. +61 −0 test/reflection_php4_test.php
  95. +263 −0 test/reflection_php5_test.php
  96. +19 −0 test/remote_test.php
  97. +38 −0 test/shell_test.php
  98. +42 −0 test/shell_tester_test.php
  99. +58 −0 test/simpletest_test.php
  100. +6 −0 test/site/file.html
  101. +25 −0 test/socket_test.php
  102. 0 test/support/collector/collectable.1
  103. 0 test/support/collector/collectable.2
  104. +3 −0 test/support/empty_test_file.php
  105. +9 −0 test/support/failing_test.php
  106. +1 −0 test/support/latin1_sample
  107. +9 −0 test/support/passing_test.php
  108. +15 −0 test/support/spl_examples.php
  109. +1 −0 test/support/supplementary_upload_sample.txt
  110. +7 −0 test/support/test1.php
  111. +1 −0 test/support/upload_sample.txt
  112. +554 −0 test/tag_test.php
  113. +8 −0 test/test_with_parse_error.php
  114. +61 −0 test/unit_tester_test.php
  115. +49 −0 test/unit_tests.php
  116. +515 −0 test/url_test.php
  117. +348 −0 test/user_agent_test.php
  118. +495 −0 test/visual_test.php
  119. +155 −0 test/web_tester_test.php
  120. +187 −0 test/xml_test.php
  121. +658 −0 test_case.php
  122. +382 −0 tidy_parser.php
  123. +413 −0 unit_tester.php
  124. +550 −0 url.php
  125. +328 −0 user_agent.php
  126. +1,532 −0 web_tester.php
  127. +647 −0 xml.php
@@ -0,0 +1,399 @@
+Simple Test interface changes
+Because the SimpleTest tool set is still evolving it is likely that tests
+written with earlier versions will fail with the newest ones. The most
+dramatic changes are in the alpha releases. Here is a list of possible
+problems and their fixes...
+assertText() no longer finds a string inside a <script> tag
+The assertText() method is intended to match only visible,
+human-readable text on the web page. Therefore, the contents of script
+tags should not be matched by this assertion. However there was a bug
+in the text normalisation code of simpletest which meant that <script>
+tags spanning multiple lines would not have their content stripped
+out. If you want to check the content of a <script> tag, use
+assertPattern(), or write a custom expectation.
+Overloaded method not working
+All protected and private methods had underscores
+removed. This means that any private/protected methods that
+you overloaded with those names need to be updated.
+Fatal error: Call to undefined method Classname::classname()
+SimpleTest renamed all of its constructors from
+Classname to __construct; derived classes invoking
+their parent constructors should replace parent::Classname()
+with parent::__construct().
+Custom CSS in HtmlReporter not being applied
+Batch rename of protected and private methods
+means that _getCss() was renamed to getCss().
+Please rename your method and it should work again.
+setReturnReference() throws errors in E_STRICT
+Happens when an object is passed by reference.
+This also happens with setReturnReferenceAt().
+If you want to return objects then replace these
+with calls to returns() and returnsAt() with the
+same arguments. This change was forced in the 1.1
+version for E_STRICT compatibility.
+assertReference() throws errors in E_STRICT
+Due to language restrictions you cannot compare
+both variables and objects in E_STRICT mode. Use
+assertSame() in this mode with objects. This change
+was forced the 1.1 version.
+Cannot create GroupTest
+The GroupTest has been renamed TestSuite (see below).
+It was removed completely in 1.1 in favour of this
+No method getRelativeUrls() or getAbsoluteUrls()
+These methods were always a bit weird anyway, and
+the new parsing of the base tag makes them more so.
+They have been replaced with getUrls() instead. If
+you want the old functionality then simply chop
+off the current domain from getUrls().
+Method setWildcard() removed in mocks
+Even setWildcard() has been removed in 1.0.1beta now.
+If you want to test explicitely for a '*' string, then
+simply pass in new IdenticalExpectation('*') instead.
+No method _getTest() on mocks
+This has finally been removed. It was a pretty esoteric
+flex point anyway. It was there to allow the mocks to
+work with other test tools, but no one does this.
+No method assertError(), assertNoErrors(), swallowErrors()
+These have been deprecated in 1.0.1beta in favour of
+expectError() and expectException(). assertNoErrors() is
+redundant if you use expectError() as failures are now reported
+No method TestCase::signal()
+This has been deprecated in favour of triggering an error or
+throwing an exception. Deprecated as of 1.0.1beta.
+No method TestCase::sendMessage()
+This has been deprecated as of 1.0.1beta.
+Failure to connect now emits failures
+It used to be that you would have to use the
+getTransferError() call on the web tester to see if
+there was a socket level error in a fetch. This check
+is now always carried out by the WebTestCase unless
+the fetch is prefaced with WebTestCase::ignoreErrors().
+The ignore directive only lasts for the next fetching
+action such as get() and click().
+No method SimpleTestOptions::ignore()
+This is deprecated in version 1.0.1beta and has been moved
+to SimpleTest::ignore() as that is more readable. In
+addition, parent classes are also ignored automatically.
+If you are using PHP5 you can skip this directive simply
+by marking your test case as abstract.
+No method assertCopy()
+This is deprecated in 1.0.1 in favour of assertClone().
+The assertClone() method is slightly different in that
+the objects must be identical, but without being a
+reference. It is thus not a strict inversion of
+Constructor wildcard override has no effect in mocks
+As of 1.0.1beta this is now set with setWildcard() instead
+of in the constructor.
+No methods setStubBaseClass()/getStubBaseClass()
+As mocks are now used instead of stubs, these methods
+stopped working and are now removed as of the 1.0.1beta
+release. The mock objects may be freely used instead.
+No method addPartialMockCode()
+The ability to insert arbitrary partial mock code
+has been removed. This was a low value feature
+causing needless complications. It was removed
+in the 1.0.1beta release.
+No method setMockBaseClass()
+The ability to change the mock base class has been
+scheduled for removal and is deprecated since the
+1.0.1beta version. This was a rarely used feature
+except as a workaround for PHP5 limitations. As
+these limitations are being resolved it's hoped
+that the bundled mocks can be used directly.
+No class Stub
+Server stubs are deprecated from 1.0.1 as the mocks now
+have exactly the same interface. Just use mock objects
+No class SimpleTestOptions
+This was replced by the shorter SimpleTest in 1.0.1beta1
+and is since deprecated.
+No file simple_test.php
+This was renamed test_case.php in 1.0.1beta to more accurately
+reflect it's purpose. This file should never be directly
+included in test suites though, as it's part of the
+underlying mechanics and has a tendency to be refactored.
+No class WantedPatternExpectation
+This was deprecated in 1.0.1alpha in favour of the simpler
+name PatternExpectation.
+No class NoUnwantedPatternExpectation
+This was deprecated in 1.0.1alpha in favour of the simpler
+name NoPatternExpectation.
+No method assertNoUnwantedPattern()
+This has been renamed to assertNoPattern() in 1.0.1alpha and
+the old form is deprecated.
+No method assertWantedPattern()
+This has been renamed to assertPattern() in 1.0.1alpha and
+the old form is deprecated.
+No method assertExpectation()
+This was renamed as assert() in 1.0.1alpha and the old form
+has been deprecated.
+No class WildcardExpectation
+This was a mostly internal class for the mock objects. It was
+renamed AnythingExpectation to bring it closer to JMock and
+NMock in version 1.0.1alpha.
+Missing UnitTestCase::assertErrorPattern()
+This method is deprecated for version 1.0.1 onwards.
+This method has been subsumed by assertError() that can now
+take an expectation. Simply pass a PatternExpectation
+into assertError() to simulate the old behaviour.
+No HTML when matching page elements
+This behaviour has been switched to using plain text as if it
+were seen by the user of the browser. This means that HTML tags
+are suppressed, entities are converted and whitespace is
+normalised. This should make it easier to match items in forms.
+Also images are replaced with their "alt" text so that they
+can be matched as well.
+No method SimpleRunner::_getTestCase()
+This was made public as getTestCase() in 1.0RC2.
+No method restartSession()
+This was renamed to restart() in the WebTestCase, SimpleBrowser
+and the underlying SimpleUserAgent in 1.0RC2. Because it was
+undocumented anyway, no attempt was made at backward
+My custom test case ignored by tally()
+The _assertTrue method has had it's signature changed due to a bug
+in the PHP 5.0.1 release. You must now use getTest() from within
+that method to get the test case. Mock compatibility with other
+unit testers is now deprecated as of 1.0.1alpha as PEAR::PHPUnit2
+should soon have mock support of it's own.
+Broken code extending SimpleRunner
+This was replaced with SimpleScorer so that I could use the runner
+name in another class. This happened in RC1 development and there
+is no easy backward compatibility fix. The solution is simply to
+extend SimpleScorer instead.
+Missing method getBaseCookieValue()
+This was renamed getCurrentCookieValue() in RC1.
+Missing files from the SimpleTest suite
+Versions of SimpleTest prior to Beta6 required a SIMPLE_TEST constant
+to point at the SimpleTest folder location before any of the toolset
+was loaded. This is no longer documented as it is now unnecessary
+for later versions. If you are using an earlier version you may
+need this constant. Consult the documentation that was bundled with
+the release that you are using or upgrade to Beta6 or later.
+No method SimpleBrowser::getCurrentUrl()
+This is replaced with the more versatile showRequest() for
+debugging. It only existed in this context for version Beta5.
+Later versions will have SimpleBrowser::getHistory() for tracking
+paths through pages. It is renamed as getUrl() since 1.0RC1.
+No method Stub::setStubBaseClass()
+This method has finally been removed in 1.0RC1. Use
+SimpleTestOptions::setStubBaseClass() instead.
+No class CommandLineReporter
+This was renamed to TextReporter in Beta3 and the deprecated version
+was removed in 1.0RC1.
+No method requireReturn()
+This was deprecated in Beta3 and is now removed.
+No method expectCookie()
+This method was abruptly removed in Beta4 so as to simplify the internals
+until another mechanism can replace it. As a workaround it is necessary
+to assert that the cookie has changed by setting it before the page
+fetch and then assert the desired value.
+No method clickSubmitByFormId()
+This method had an incorrect name as no button was involved. It was
+renamed to submitByFormId() in Beta4 and the old version deprecated.
+Now removed.
+No method paintStart() or paintEnd()
+You should only get this error if you have subclassed the lower level
+reporting and test runner machinery. These methods have been broken
+down into events for test methods, events for test cases and events
+for group tests. The new methods are...
+paintStart() --> paintMethodStart(), paintCaseStart(), paintGroupStart()
+paintEnd() --> paintMethodEnd(), paintCaseEnd(), paintGroupEnd()
+This change was made in Beta3, ironically to make it easier to subclass
+the inner machinery. Simply duplicating the code you had in the previous
+methods should provide a temporary fix.
+No class TestDisplay
+This has been folded into SimpleReporter in Beta3 and is now deprecated.
+It was removed in RC1.
+No method WebTestCase::fetch()
+This was renamed get() in Alpha8. It is removed in Beta3.
+No method submit()
+This has been renamed clickSubmit() in Beta1. The old method was
+removed in Beta2.
+No method clearHistory()
+This method is deprecated in Beta2 and removed in RC1.
+No method getCallCount()
+This method has been deprecated since Beta1 and has now been
+removed. There are now more ways to set expectations on counts
+and so this method should be unecessery. Removed in RC1.
+Cannot find file *
+The following public name changes have occoured...
+simple_html_test.php --> reporter.php
+simple_mock.php --> mock_objects.php
+simple_unit.php --> unit_tester.php
+simple_web.php --> web_tester.php
+The old names were deprecated in Alpha8 and removed in Beta1.
+No method attachObserver()
+Prior to the Alpha8 release the old internal observer pattern was
+gutted and replaced with a visitor. This is to trade flexibility of
+test case expansion against the ease of writing user interfaces.
+Code such as...
+$test = &new MyTestCase();
+$test->attachObserver(new TestHtmlDisplay());
+...should be rewritten as...
+$test = &new MyTestCase();
+$test->run(new HtmlReporter());
+If you previously attached multiple observers then the workaround
+is to run the tests twice, once with each, until they can be combined.
+For one observer the old method is simulated in Alpha 8, but is
+removed in Beta1.
+No class TestHtmlDisplay
+This class has been renamed to HtmlReporter in Alpha8. It is supported,
+but deprecated in Beta1 and removed in Beta2. If you have subclassed
+the display for your own design, then you will have to extend this
+class (HtmlReporter) instead.
+If you have accessed the event queue by overriding the notify() method
+then I am afraid you are in big trouble :(. The reporter is now
+carried around the test suite by the runner classes and the methods
+called directly. In the unlikely event that this is a problem and
+you don't want to upgrade the test tool then simplest is to write your
+own runner class and invoke the tests with...
+$test->accept(new MyRunner(new MyReporter()));
+...rather than the run method. This should be easier to extend
+anyway and gives much more control. Even this method is overhauled
+in Beta3 where the runner class can be set within the test case. Really
+the best thing to do is to upgrade to this version as whatever you were
+trying to achieve before should now be very much easier.
+Missing set options method
+All test suite options are now in one class called SimpleTestOptions.
+This means that options are set differently...
+GroupTest::ignore() --> SimpleTestOptions::ignore()
+Mock::setMockBaseClass() --> SimpleTestOptions::setMockBaseClass()
+These changed in Alpha8 and the old versions are now removed in RC1.
+No method setExpected*()
+The mock expectations changed their names in Alpha4 and the old names
+ceased to be supported in Alpha8. The changes are...
+setExpectedArguments() --> expectArguments()
+setExpectedArgumentsSequence() --> expectArgumentsAt()
+setExpectedCallCount() --> expectCallCount()
+setMaximumCallCount() --> expectMaximumCallCount()
+The parameters remained the same.
Oops, something went wrong.

0 comments on commit 8b890cb

Please sign in to comment.