You are here

public function FrxTestCase::setUp in Forena Reports 8

Mock object instantiation.

Overrides UnitTestCase::setUp

2 methods override FrxTestCase::setUp()
DataManagerTest::setUp in tests/src/Unit/DataManagerTest.php
Mock object instantiation.
ForenaTest::setUp in tests/src/Unit/ForenaTest.php
Mock object instantiation.

File

tests/src/Unit/FrxTestCase.php, line 27

Class

FrxTestCase

Namespace

Drupal\Tests\forena\Unit

Code

public function setUp() {

  // Instantiate Mock Object. Order is important here.

  /** @var TestingAppService $app */
  $app = TestingAppService::instance(TRUE);
  TestingDataManager::instance(TRUE);
  TestingReportFileSystem::instance(TRUE);
  $app->form_state = new FormState();
  $app->parameterForm = $this
    ->getMockBuilder('\\Drupal\\forena\\Form\\ParameterForm')
    ->setMethods([
    't',
  ])
    ->getMock();
  $app->parameterForm
    ->method('t')
    ->will($this
    ->returnArgument(0));
}