function BuildTestTest::testStandUpServer

Same name and namespace in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php \Drupal\BuildTests\Framework\Tests\BuildTestTest::testStandUpServer()
  2. 8.9.x core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php \Drupal\BuildTests\Framework\Tests\BuildTestTest::testStandUpServer()
  3. 10 core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php \Drupal\BuildTests\Framework\Tests\BuildTestTest::testStandUpServer()

@covers ::standUpServer

File

core/tests/Drupal/BuildTests/Framework/Tests/BuildTestTest.php, line 239

Class

BuildTestTest
@coversDefaultClass <a href="/api/drupal/core%21tests%21Drupal%21BuildTests%21Framework%21BuildTestBase.php/class/BuildTestBase/11.x" title="Provides a workspace to test build processes." class="local">\Drupal\BuildTests\Framework\BuildTestBase</a> @group Build

Namespace

Drupal\BuildTests\Framework\Tests

Code

public function testStandUpServer() : void {
    // Stand up a server with working directory 'first'.
    $this->standUpServer('first');
    // Get the process object for the server.
    $ref_process = new \ReflectionProperty(parent::class, 'serverProcess');
    $first_process = $ref_process->getValue($this);
    // Standing up the server again should not change the server process.
    $this->standUpServer('first');
    $this->assertSame($first_process, $ref_process->getValue($this));
    // Standing up the server with working directory 'second' should give us a
    // new server process.
    $this->standUpServer('second');
    $this->assertNotSame($first_process, $second_process = $ref_process->getValue($this));
    // And even with the original working directory name, we should get a new
    // server process.
    $this->standUpServer('first');
    $this->assertNotSame($first_process, $ref_process->getValue($this));
    $this->assertNotSame($second_process, $ref_process->getValue($this));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.