Beispiel #1
0
 public function testCompareOwner()
 {
     $project = new GitPHP_Project(GITPHP_TEST_PROJECTROOT, 'testrepoexported.git', $this->getMock('GitPHP_ProjectLoadStrategy_Interface'));
     $project->SetOwner('A owner');
     $project2 = new GitPHP_Project(GITPHP_TEST_PROJECTROOT, 'testrepo.git', $this->getMock('GitPHP_ProjectLoadStrategy_Interface'));
     $project->SetOwner('B owner');
     $this->assertEquals(0, GitPHP_Project::CompareOwner($project, $project));
     $this->assertLessThan(0, GitPHP_Project::CompareOwner($project, $project2));
     $this->assertGreaterThan(0, GitPHP_Project::CompareOwner($project2, $project));
     $project->SetCategory('b');
     $this->assertEquals(0, GitPHP_Project::CompareOwner($project, $project));
     $this->assertGreaterThan(0, GitPHP_Project::CompareOwner($project, $project2));
     $this->assertLessThan(0, GitPHP_Project::CompareOwner($project2, $project));
     $project2->SetCategory('a');
     $this->assertEquals(0, GitPHP_Project::CompareOwner($project, $project));
     $this->assertGreaterThan(0, GitPHP_Project::CompareOwner($project, $project2));
     $this->assertLessThan(0, GitPHP_Project::CompareOwner($project2, $project));
 }