UnittestsBind server sockets to any free portat 2010-02-01 in Unittests, Editorial, Announcements by friebeAt the company I work for, we let the XP Framework's unittest run on various different machines, including Windows 2008 server and 32- as well as 64-bit Debian Linux boxes, with PHP versions ranging from 5.2.0 - 5.3.1 (lots of permutation, yes). ![]() On some of the newer machines we have configured Hudson to start multiple test runners at the same time. This lead to problems with the integration tests (for the FTP API, for example) where we actually fork off a standalone server in the background: The port in use was hardcoded. While this is perfectly OK normally, with mutiples suites executing simultaneously and trying to bind the same port, we were running into problems. (more) XP on a Macat 2010-01-24 in Releases, Unittests by friebeContinuing our series of trying to get the XP Framework run on as many platforms as possible, here's our newest achievement: ![]() So far we have:
Continuous integration with Hudsonat 2009-10-02 in Unittests by friebeThe XP Framework's unittest suite has been extended by a new test listener which produces an XML file adequate for continuous integration systems. Test listeners receive events such as when as test run is started, a test succeeds, fails or is skipped and finally when the run is completed. In fact, the dots you see appearing on your console when running tests are implemented with a listener! Here's what the Hudson dashboard looks like: ![]() To make the unittest command produce the XML files necessary to have Hudson render this overview, use the "-l" option: $ unittest -l unittest.XmlTestListener hudson.xml [test [test [...]]] Happy testing RFC #0188: Test outcomeat 2009-09-28 in RFCs, Unittests by friebeScope of Change At the moment, there are three possible outcomes of a unittest: Succeeded, Skipped and Failed. This RFC suggests adding more kinds of outcomes: Error and NotRun. Rationale Be able to distinguish between the different non-success reasons. Read the full RFC here RFC #0187: @expect withMessageat 2009-08-23 in RFCs, Unittests by friebeScope of Change The @expect annotation will be enhanced to provide a means for also checking the expected exception's message. Rationale Ensuring a certain exception message requires the "old-style" approach with try, fail(); and the checking the message inside catch (ExpectedException $expected), a construct we successfully removed the need for with @expect years ago. Read the full RFC here Discovering unittestsat 2009-06-01 in Unittests, Examples by friebeIn the api documentation of a class, certain tags can be used, such as @see, @param or @return. Not only can they be used but it's actually strongly encouraged (you knew that, though). To discover unittests by a given class name, the doclet API can be used. (more) Feature showcase: Unittest & equalityat 2009-03-28 in Unittests by friebeWith the 5.7.2 release out, the unittest API now shows errors more concisely. Assume we have the following: <?php Before, this used to show { expected: [1] but was: [1] } (this is because the AssertionFailedError class uses string casts). The new output now is { expected: [integer:1] but was: [double:1] }, which is positively better readable Heads up: Framework unittestsat 2009-03-27 in Unittests, Announcements by friebeThe archive xp-net.xp_framework-{VERSION}.xar, which contains the framework's unittests, has been removed from the boot classpath. It is no longer required for the XP runners (which is why it was originally there), classes used for these are all now in xp-tools-${VERSION}.xar. To run unittests on a released version, use the following: $ unittest -cp {VERSION}/lib/xp-net.xp_framework-{VERSION}.xar [tests]Example: $ unittest -cp 5.7.2/lib/xp-net.xp_framework-5.7.2.xar net.xp_framework.unittest.core.* RFC #0169: New package unittest.webat 2008-08-14 in RFCs, Unittests by friebeScope of Change A new package unittest.web will be created. It will contain the base class WebTestCase with which web tests can be written. Rationale Integration testing. Read the full RFC here RFC #0150: Before and after methods for testcasesat 2008-01-06 in RFCs, Unittests by friebeScope of Change There will be a way to run methods prior to and after all tests in a TestCase class. In contrast to setUp() and tearDown() they will be run only once per class and not once per test. Rationale Initialize and dispose of resources that are expensive to create, e.g. a server instance, a network connection, ... Read the full RFC here |
|