2 // vim: foldmethod=marker
4 * Ethna_Plugin_Handle_PearLocal_Test.php
6 * @author Yoshinari Takaoka <takaoka@beatcraft.com>
10 require_once ETHNA_BASE . '/test/Ethna_MockProject.php';
12 //{{{ Ethna_Plugin_Handle_PearLocal_Test
14 * Test Case For Ethna_Plugin_Handle_PearLocal_Test
18 class Ethna_Plugin_Handle_PearLocal_Test extends Ethna_UnitTestBase
24 $this->proj = new Ethna_MockProject();
25 $r = $this->proj->create();
26 if (Ethna::isError($r)) {
27 $this->fail($r->getMessage());
33 $this->proj->delete();
36 function test_cmd_option()
38 // unrecognized option
39 $r = $this->proj->runCmd('pear-local', array('-k'));
40 $this->assertTrue(Ethna::isError($r));
41 $this->assertEqual('unrecognized option -k', $r->getMessage());
43 // pear list -a(get no error)
44 // @see http://sourceforge.jp/ticket/browse.php?group_id=1343&tid=15760
45 $r = $this->proj->runCmd('pear-local', array('list', '-a'));
46 $this->assertFalse(Ethna::isError($r));
48 // channel requires an argument
49 $r = $this->proj->runCmd('pear-local', array('-c'));
50 $this->assertTrue(Ethna::isError($r));
51 $this->assertEqual('option -c requires an argument', $r->getMessage());
53 $r = $this->proj->runCmd('pear-local', array('--channel'));
54 $this->assertTrue(Ethna::isError($r));
55 $this->assertEqual('option --channel requires an argument', $r->getMessage());
57 // normal command exexute
58 $r = $this->proj->runCmd('pear-local', array('install', 'Date'));
59 $this->assertFalse(Ethna::isError($r));