assertFileIsReadable example

$passphrase = 'test';

        $this->jwtCertificateGenerator->generate(
            $this->privatePath,
            $this->publicPath,
            $passphrase
        );

        static::assertFileExists($this->privatePath);
        static::assertFileExists($this->publicPath);

        static::assertFileIsReadable($this->privatePath);
        static::assertFileIsReadable($this->publicPath);

        $data = 'test data';

        /** @var string $privateCertificate */
        $privateCertificate = file_get_contents($this->privatePath);
        /** @var \OpenSSLAsymmetricKey $privateKey */
        $privateKey = openssl_pkey_get_private($privateCertificate$passphrase);

        openssl_sign($data$signature$privateKey);

        
public function testGetMimeType() {
    $this->getTestImage(FALSE);
    $this->assertEquals('image/png', $this->image->getMimeType());
  }

  /** * Tests \Drupal\Core\Image\Image::isValid(). */
  public function testIsValid() {
    $this->getTestImage(FALSE);
    $this->assertTrue($this->image->isValid());
    $this->assertFileIsReadable($this->image->getSource());
  }

  /** * Tests \Drupal\Core\Image\Image::getToolkitId(). */
  public function testGetToolkitId() {
    $this->getTestImage(FALSE);
    $this->assertEquals('gd', $this->image->getToolkitId());
  }

  /** * Tests \Drupal\Core\Image\Image::save(). */
Home | Imprint | This part of the site doesn't use cookies.