Пример #1
0
 public function testCreateProjectWithGroupWithoutAdmin()
 {
     $project = USVN_Project::createProject(array('projects_name' => 'InsertProjectOk', 'projects_start_date' => '1984-12-03 00:00:00'), "test", true, true, false, true);
     $table = new USVN_Db_Table_Projects();
     $this->assertTrue($table->isAProject('InsertProjectOk'), "Le projet n'est pas cree");
     $this->assertTrue(USVN_SVNUtils::isSVNRepository('tests/tmp/svn/InsertProjectOk'), "Le repository n'est pas cree");
     $table = new USVN_Db_Table_Groups();
     $this->assertTrue($table->isAGroup('InsertProjectOk'), "Le groupe n'est pas cree");
     $group = $table->fetchRow(array("groups_name = ?" => 'InsertProjectOk'));
     $table = new USVN_Db_Table_FilesRights();
     $right = $table->fetchRow(array("files_rights_path = ?" => "/", "projects_id = ?" => $project->id));
     $this->assertNotNull($right, "La ligne pour les droits sur / n'a pas ete trouvee");
     $table = new USVN_Db_Table_GroupsToFilesRights();
     $rights = $table->fetchRow(array("files_rights_id = ?" => $right->id, "groups_id = ?" => $group->id));
     $this->assertNotNull($rights, "La ligne pour les droits du groupe n'a pas ete trouvee");
     $this->assertEquals(1, $rights->files_rights_is_readable, "Le groupe n'a pas la lecture");
     $this->assertEquals(1, $rights->files_rights_is_readable, "Le groupe n'a pas l'ecriture");
     $this->assertTrue($group->hasUser($this->_user));
     $this->assertFalse($project->userIsAdmin($this->_user));
 }