Skip to content

Commit

Permalink
Merge branch '2.4' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 23, 2021
2 parents 36ea111 + 724ac55 commit 4ccabdf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/GenerateCSVJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace SilverStripe\GridFieldQueuedExport\Tests;

use SilverStripe\Assets\Filesystem;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
Expand Down Expand Up @@ -42,16 +43,16 @@ protected function tearDown()
public function testGenerateExport()
{
// Build session
$memberID = $this->logInWithPermission('ADMIN');
$session = ['loggedInAs' => $memberID];
$this->logInWithPermission('ADMIN');
$sessionData = Controller::curr()->getRequest()->getSession()->getAll();

// Build controller
$controller = new GenerateCSVJobTestController();
$form = $controller->Form();
$gridfield = $form->Fields()->fieldByName('MyGridfield');

// Build job
$job = $this->createJob($gridfield, $session);
$job = $this->createJob($gridfield, $sessionData);
$path = sprintf('%1$s/.exports/%2$s/%2$s.csv', ASSETS_PATH, $job->getSignature());
$this->paths[] = $path; // Mark for cleanup later

Expand Down Expand Up @@ -80,8 +81,8 @@ public function testGenerateExportOverMultipleSteps()
Config::modify()->set(GenerateCSVJob::class, 'chunk_size', 1);

// Build session
$memberID = $this->logInWithPermission('ADMIN');
$session = ['loggedInAs' => $memberID];
$this->logInWithPermission('ADMIN');
$sessionData = Controller::curr()->getRequest()->getSession()->getAll();

// Build controller
$controller = new GenerateCSVJobTestController();
Expand All @@ -90,7 +91,7 @@ public function testGenerateExportOverMultipleSteps()
$gridfield = $form->Fields()->fieldByName('MyGridfield');

// Build job
$job = $this->createJob($gridfield, $session);
$job = $this->createJob($gridfield, $sessionData);
$path = sprintf('%1$s/.exports/%2$s/%2$s.csv', ASSETS_PATH, $job->getSignature());
$this->paths[] = $path; // Mark for cleanup later

Expand Down

0 comments on commit 4ccabdf

Please sign in to comment.