Verified Commit 9c045e0c authored by Jess's avatar Jess
Browse files

Issue #3445847 by Alexander Allen, mstrelan, catch, xjm, longwave,...

Issue #3445847 by Alexander Allen, mstrelan, catch, xjm, longwave, mark_fullmer: PHPUnit 10 behaves differently when invoked outside web root

(cherry picked from commit b064d944)
parent 5a3a9165
Loading
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -33,9 +33,8 @@ class FileSaveUploadTest extends KernelTestBase {
   * {@inheritdoc}
   */
  protected function setUp(): void {
    \file_put_contents('test.bbb', 'test');

    parent::setUp();
    \file_put_contents('test.bbb', 'test');
    $request = new Request();
    $request->files->set('files', [
      'file' => new UploadedFile(
@@ -53,6 +52,14 @@ protected function setUp(): void {
    $this->container->set('request_stack', $requestStack);
  }

  /**
   * {@inheritdoc}
   */
  protected function tearDown(): void {
    \unlink('test.bbb');
    parent::tearDown();
  }

  /**
   * Tests file_save_upload() with empty extensions.
   */
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ protected function setUp(): void {
    // is not the one the test requires, skip before test database
    // initialization so to save cycles.
    $this->root = static::getDrupalRoot();
    chdir($this->root);
    $connectionInfo = $this->getDatabaseConnectionInfo();
    $test_class_parts = explode('\\', get_class($this));
    $expected_provider = $test_class_parts[2] ?? '';
+1 −0
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ protected function setUp(): void {
    $this->registerComparator(new MarkupInterfaceComparator());

    $this->root = static::getDrupalRoot();
    chdir($this->root);
    $this->initFileCache();
    $this->bootEnvironment();
    $this->bootKernel();
+1 −0
Original line number Diff line number Diff line
@@ -351,6 +351,7 @@ protected function setUp(): void {
    parent::setUp();

    $this->setUpAppRoot();
    chdir($this->root);

    // Allow tests to compare MarkupInterface objects via assertEquals().
    $this->registerComparator(new MarkupInterfaceComparator());
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ protected function setUp(): void {
    $php_executable_finder = new PhpExecutableFinder();
    $this->php = $php_executable_finder->find();
    $this->root = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__)), 2);
    chdir($this->root);
    if (!is_writable("{$this->root}/sites/simpletest")) {
      $this->markTestSkipped('This test requires a writable sites/simpletest directory');
    }
Loading