예제 #1
0
 public function testGetCLISubjects()
 {
     $subject1 = 'first';
     $subject2 = 'second';
     $bc = BaseCommand::getInstance();
     $ref_bc = new ReflectionClass($bc);
     $ref_bc_subj1_prop = $ref_bc->getProperty('commandSubject');
     $ref_bc_subj1_prop->setAccessible(true);
     $ref_bc_subj1_prop->setValue($bc, $subject1);
     $ref_bc_subj2_prop = $ref_bc->getProperty('commandSubject2');
     $ref_bc_subj2_prop->setAccessible(true);
     $ref_bc_subj2_prop->setValue($bc, $subject2);
     $ref_bc_cli_meth = $ref_bc->getMethod('getCLISubjects');
     $ref_bc_cli_meth->setAccessible(true);
     $expected = " '{$subject1}' '{$subject2}'";
     $actual = $ref_bc_cli_meth->invoke($bc);
     $this->assertSame($expected, $actual);
 }
예제 #2
0
 /**
  * constructor
  *
  * @param \GitElephant\Repository $repo The repository object this command 
  *                                      will interact with
  */
 public function __construct(Repository $repo = null)
 {
     parent::__construct($repo);
 }
예제 #3
0
 /**
  * Clear all previous variables
  */
 public function clearAll()
 {
     parent::clearAll();
     $this->orderedSubjects = null;
 }