public function testProjectCRUD_CRUDOK()
 {
     $e = new ApiCrudTestEnvironment();
     $userId = $e->e->createUser('userName', 'User Name', '*****@*****.**', SystemRoles::SYSTEM_ADMIN);
     $id = ProjectCommands::createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE, 'sfchecks', $userId, $e->e->website);
     $this->assertNotNull($id);
     $this->assertEqual(24, strlen($id));
     // Read
     $result = ProjectCommands::readProject($id);
     $this->assertNotNull($result['id']);
     $this->assertEqual(SF_TESTPROJECT, $result['projectName']);
     // Update
     $result['language'] = 'AnotherLanguage';
     $id = SfchecksProjectCommands::updateProject($id, $userId, $e->json($result));
     $this->assertNotNull($id);
     $this->assertEqual($result['id'], $id);
     // Delete
     $result = ProjectCommands::deleteProjects(array($id));
     $this->assertTrue($result);
 }
示例#2
0
 /**
  * Read a project from the given $id
  *
  * @param string $id
  */
 public function project_read($id)
 {
     return ProjectCommands::readProject($id);
 }