File: console_commandline_accept.phpt

package info (click to toggle)
php-console-commandline 1.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772 kB
  • sloc: php: 1,394; xml: 166; sh: 5; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
Test for Console_CommandLine::accept() method.
--FILE--
<?php

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tests.inc.php';

$parser = buildParser1();
try {
    // custom renderer
    $parser->accept(new CustomRenderer());
    echo get_class($parser->renderer) . "\n";
    // outputter
    $parser->accept(new CustomOutputter());
    echo get_class($parser->outputter) . "\n";
    $parser->accept(new CustomMessageProvider());
    echo get_class($parser->message_provider) . "\n";
    $parser->accept(new stdclass());
} catch (Console_CommandLine_Exception $exc) {
    $parser->displayError($exc->getMessage());
}

?>
--EXPECT--
CustomRenderer
CustomOutputter
CustomMessageProvider
STDERR >> CustomRenderer::error(INVALID_CUSTOM_INSTANCE)