root/framework/trunk/src/test/php/net/stubbles/websites/stubWebApplicationRunnerTestCase.php @ 2519

Revision 2519, 1.9 kB (checked in by bensch, 6 months ago)

fixed import

  • Property svn:keywords set to Id
Line 
1<?php
2/**
3 * Test for net::stubbles::websites::stubWebApplicationRunner.
4 *
5 * @package     stubbles
6 * @subpackage  websites_test
7 * @version     $Id$
8 */
9stubClassLoader::load('net::stubbles::websites::stubWebApplicationRunner',
10                      'net::stubbles::websites::stubWebApplication'
11);
12/**
13 * Helper class for the test.
14 *
15 * @package     stubbles
16 * @subpackage  websites_test
17 */
18class SuccesfulWebApplication extends stubBaseObject implements stubWebApplication
19{
20    /**
21     * runs the web application
22     *
23     * @return  int
24     */
25    public function run()
26    {
27        return 0;
28    }
29}
30/**
31 * Helper class for the test.
32 *
33 * @package     stubbles
34 * @subpackage  websites_test
35 */
36class FailingWebApplication extends stubBaseObject implements stubWebApplication
37{
38    /**
39     * runs the web application
40     *
41     * @throws  Exception
42     */
43    public function run()
44    {
45        throw new Exception('Error');
46    }
47}
48/**
49 * Test for net::stubbles::websites::stubWebApplicationRunner.
50 *
51 * @package     stubbles
52 * @subpackage  websites_test
53 * @since       1.2.0
54 * @group       websites
55 */
56class stubWebApplicationRunnerTestCase extends PHPUnit_Framework_TestCase
57{
58    /**
59     * @test
60     */
61    public function successfulWebApplication()
62    {
63        $this->assertEquals(0,
64                            stubWebApplicationRunner::main(stubBootstrap::getRootPath() . '/projects/dist',
65                                                           'SuccesfulWebApplication'
66                            )
67        );
68    }
69
70    /**
71     * @test
72     */
73    public function exceptionIsCaught()
74    {
75        $this->assertEquals(70,
76                            stubWebApplicationRunner::main(stubBootstrap::getRootPath() . '/projects/dist',
77                                                           'FailingWebApplication'
78                            )
79        );
80    }
81}
82?>
Note: See TracBrowser for help on using the browser.