From a3388622287e218beddfa14a47ed677d4307b36b Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Fri, 25 Mar 2016 17:55:51 +0100 Subject: Removed simpletest and moved all tests in the unit tree Tests are executed now, but a lot of them need fixing. --- tests/test_tools/simpletest/docs/en/overview.html | 406 ---------------------- 1 file changed, 406 deletions(-) delete mode 100755 tests/test_tools/simpletest/docs/en/overview.html (limited to 'tests/test_tools/simpletest/docs/en/overview.html') diff --git a/tests/test_tools/simpletest/docs/en/overview.html b/tests/test_tools/simpletest/docs/en/overview.html deleted file mode 100755 index 5d4e80e2..00000000 --- a/tests/test_tools/simpletest/docs/en/overview.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - Overview and feature list for the SimpleTest PHP unit tester and web tester - - - - - -

Overview of SimpleTest

-
-

- -

What is SimpleTest?

- -

-

- The heart of SimpleTest is a testing framework built around - test case classes. - These are written as extensions of base test case classes, - each extended with methods that actually contain test code. - Top level test scripts then invoke the run() - methods on every one of these test cases in order. - Each test method is written to invoke various assertions that - the developer expects to be true such as - assertEqual(). - If the expectation is correct, then a successful result is dispatched to the - observing test reporter, but any failure triggers an alert - and a description of the mismatch. -

-

- A test case looks like this... -

-<?php
-class MyTestCase extends UnitTestCase {
-    
-    function testLog() {
-        $log = &new Log('my.log');
-        $log->message('Hello');
-        $this->assertTrue(file_exists('my.log'));
-    }
-}
-?>
-
-

-

- These tools are designed for the developer. - Tests are written in the PHP language itself more or less - as the application itself is built. - The advantage of using PHP itself as the testing language is that - there are no new languages to learn, testing can start straight away, - and the developer can test any part of the code. - Basically, all parts that can be accessed by the application code can also be - accessed by the test code if they are in the same language. -

-

- The simplest type of test case is the - UnitTestCase. - This class of test case includes standard tests for equality, - references and pattern matching. - All these test the typical expectations of what you would - expect the result of a function or method to be. - This is by far the most common type of test in the daily - routine of development, making up about 95% of test cases. -

-

- The top level task of a web application though is not to - produce correct output from its methods and objects, but - to generate web pages. - The WebTestCase class tests web - pages. - It simulates a web browser requesting a page, complete with - cookies, proxies, secure connections, authentication, forms, frames and most - navigation elements. - With this type of test case, the developer can assert that - information is present in the page and that forms and - sessions are handled correctly. -

-

- A WebTestCase looks like this... -

-<?php
-class MySiteTest extends WebTestCase {
-    
-    function testHomePage() {
-        $this->get('http://www.my-site.com/index.php');
-        $this->assertTitle('My Home Page');
-        $this->clickLink('Contact');
-        $this->assertTitle('Contact me');
-        $this->assertWantedPattern('/Email me at/');
-    }
-}
-?>
-
-

- -

- -

Feature list

- -

-

- The following is a very rough outline of past and future features - and their expected point of release. - I am afraid it is liable to change without warning as meeting the - milestones rather depends on time available. - Green stuff has been coded, but not necessarily released yet. - If you have a pressing need for a green but unreleased feature - then you should check-out the code from Sourceforge CVS directly. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureDescriptionRelease
Unit test caseCore test case class and assertions1.0
Html displaySimplest possible display1.0
Autoloading of test cases - Reading a file with test cases and loading them into a - group test automatically - 1.0
Mock objects - Objects capable of simulating other objects removing - test dependencies - 1.0
Web test caseAllows link following and title tag matching1.0
Partial mocks - Mocking parts of a class for testing less than a class - or for complex simulations - 1.0
Web cookie handlingCorrect handling of cookies when fetching pages1.0
Following redirectsPage fetching automatically follows 300 redirects1.0
Form parsingAbility to submit simple forms and read default form values1.0
Command line interfaceTest display without the need of a web browser1.0
Exposure of expectation classesCan create precise tests with mocks as well as test cases1.0
XML output and parsing - Allows multi host testing and the integration of acceptance - testing extensions - 1.0
Browser component - Exposure of lower level web browser interface for more - detailed test cases - 1.0
HTTP authentication - Fetching protected web pages with basic authentication - only - 1.0
SSL supportCan connect to https: pages1.0
Proxy supportCan connect via. common proxies1.0
Frames supportHandling of frames in web test cases1.0
File upload testingCan simulate the input type file tag1.0.1
Mocking interfaces - Can generate mock objects to interfaces as well as classes - and class interfaces are carried for type hints - 1.0.1
Reporting machinery enhancementsImproved message passing for better cooperation with IDEs1.1
LocalisationMessages abstracted and code generated from XML1.1
Testing exceptionsSimilar to testing PHP errors1.1
IFrame supportReads IFrame content that can be refreshed1.1
Improved mock interfaceMore compact way of expressing mocks2.0
HTML table assertionsCan match table elements to numerical assertions2.0
XPath searching of HTML elementsMore flexible content matching2.0
Alternate HTML parsersCan detect compiled parsers for performance improvements2.0
Javascript suportUse of PECL module to add Javascript3.0
- PHP5 migraton will start straight after the version 1.0.1 series, - whereupon PHP4 will no longer be supported. - SimpleTest is currently compatible with PHP5, but will not - make use of all of the new features until version 2. -

- -

- -

Web resources for testing

- -

-

- Process is at least as important as tools. - The type of process that makes the heaviest use of a developer's - testing tool is of course - Extreme Programming. - This is one of the - Agile Methodologies - which combine various practices to "flatten the cost curve" of software development. - More extreme still is Test Driven Development, - where you very strictly adhere to the rule of no coding until you have a test. - If you're more of a planner or believe that experience trumps evolution, - you may prefer the - RUP approach. - I haven't tried it, but even I can see that you will need test tools (see figure 9). -

-

- Most unit testers clone JUnit to some degree, - as far as the interface at least. There is a wealth of information on the - JUnit site including the - FAQ - which contains plenty of general advice on testing. - Once you get bitten by the bug you will certainly appreciate the phrase - test infected - coined by Eric Gamma. - If you are still reviewing which unit tester to use the main choices - are PHPUnit - and Pear PHP::PHPUnit. - They currently lack a lot of features found in - SimpleTest, but the PEAR - version at least has been upgraded for PHP5 and is recommended if you are porting - existing JUnit test cases. -

-

- There is currently a sad lack of material on mock objects, which is a shame - as unit testing without them is a lot more work. - The original mock objects paper - is very Java focused, but still worth a read. - As a new technology there are plenty of discussions and debate on how to use mocks, - often on Wikis such as - Extreme Tuesday - or www.mockobjects.com - or the original C2 Wiki. - Injecting mocks into a class is the main area of debate for which this - paper on IBM - makes a good starting point. -

-

- There are plenty of web testing tools, but the scriptable ones - are mostly are written in Java and - tutorials and advice are rather thin on the ground. - The only hope is to look at the documentation for - HTTPUnit, - HTMLUnit - or JWebUnit and hope for clues. - There are some XML driven test frameworks, but again most - require Java to run. -

-

- A new generation of tools that run directly in the web browser - are now available. - These include - Selenium and - Watir. - As SimpleTest does not support JavaScript you would probably - have to look at these tools anyway if you have highly dynamic - pages. -

- -
- - - -- cgit v1.2.3