Project

General

Profile

Bug #11529 » 11529.patch

Tolleiv Nietsch, 2011-01-15 18:35

View differences:

Tests/Service/fixtures/dbDefaultPages.xml (working copy)
<t3ver_count>1</t3ver_count>
<deleted>0</deleted>
</pages>
<pages>
<uid>301</uid>
<pid>-1</pid>
<title>Dummy WS 93</title>
<t3ver_oid>1</t3ver_oid>
<t3ver_stage>1</t3ver_stage>
<t3ver_wsid>93</t3ver_wsid>
<t3ver_count>0</t3ver_count>
<deleted>0</deleted>
</pages>
<pages>
<uid>304</uid>
<pid>-1</pid>
<title>Dummy WS 93</title>
<t3ver_oid>4</t3ver_oid>
<t3ver_stage>2</t3ver_stage>
<t3ver_wsid>93</t3ver_wsid>
<t3ver_count>0</t3ver_count>
<deleted>0</deleted>
</pages>
</dataset>
Tests/Service/fixtures/dbDefaultWorkspaces.xml (working copy)
<pid>0</pid>
<title>Filled Workspace #2</title>
</sys_workspace>
<sys_workspace>
<uid>93</uid>
<pid>0</pid>
<title>Filled Workspace #3 - to reproduce #11529</title>
</sys_workspace>
</dataset>
Tests/Service/WorkspaceTest.php (working copy)
}
/**
* Test was implemented to check #11529
*
* @test
**/
public function versionsFromSpecificWorkspaceCanBeFoundFromRoot() {
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
$service = new tx_Workspaces_Service_Workspaces();
$result = $service->selectVersionsInWorkspace(93, 0, -99);
$this->assertTrue(is_array($result), "The result from workspace 93 is supposed to be an array");
$this->assertEquals(2, sizeof($result['pages']), "The result is supposed to contain one version for this page in workspace 93");
$this->assertEquals(301, $result['pages'][0]['uid'], "Wrong workspace overlay record picked");
$this->assertEquals(0, $result['pages'][0]['livepid'], "Real pid wasn't resolved correctly");
}
/**
* Test was implemented to check #11529
*
* @test
**/
public function versionsFromSpecificWorkspaceCanBeFoundFromNull() {
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
$service = new tx_Workspaces_Service_Workspaces();
$result = $service->selectVersionsInWorkspace(93, 0, -99, Null);
$this->assertTrue(is_array($result), "The result from workspace 93 is supposed to be an array");
$this->assertEquals(2, sizeof($result['pages']), "The result is supposed to contain one version for this page in workspace 93");
$this->assertEquals(301, $result['pages'][0]['uid'], "Wrong workspace overlay record picked");
$this->assertEquals(0, $result['pages'][0]['livepid'], "Real pid wasn't resolved correctly");
}
/**
* Test was implemented to check #11529
*
* @test
**/
public function versionsFromSpecificWorkspaceCanBeFoundFromNowhere() {
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
$service = new tx_Workspaces_Service_Workspaces();
$result = $service->selectVersionsInWorkspace(93, 0, -99, -1);
$this->assertTrue(is_array($result), "The result from workspace 93 is supposed to be an array");
$this->assertEquals(2, sizeof($result['pages']), "The result is supposed to contain one version for this page in workspace 93");
$this->assertEquals(301, $result['pages'][0]['uid'], "Wrong workspace overlay record picked");
$this->assertEquals(0, $result['pages'][0]['livepid'], "Real pid wasn't resolved correctly");
}
/**
* @test
**/
public function versionsFromAllWorkspaceCanBeFound() {
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultWorkspaces.xml');
$this->importDataSet(dirname(__FILE__) . '/fixtures/dbDefaultPages.xml');
(1-1/3)