File: UploadedFileFactoryTest.php

package info (click to toggle)
php-http-interop-http-factory-tests 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: php: 549; makefile: 7
file content (33 lines) | stat: -rw-r--r-- 835 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
 * @noinspection PhpUndefinedConstantInspection
 */

namespace Interop\Http\Factory;

use function class_exists;
use function defined;

final class UploadedFileFactoryTest extends UploadedFileFactoryTestCase
{
    /**
     * {@inheritdoc}
     */
    protected function createUploadedFileFactory()
    {
        if (!defined('UPLOADED_FILE_FACTORY') || !class_exists(UPLOADED_FILE_FACTORY)) {
            self::markTestSkipped('UPLOADED_FILE_FACTORY class name not provided');
        }

        return new (UPLOADED_FILE_FACTORY);
    }

    protected function createStream($content)
    {
        if (!defined('STREAM_FACTORY') || !class_exists(STREAM_FACTORY)) {
            self::markTestSkipped('STREAM_FACTORY class name not provided');
        }

        return (new (STREAM_FACTORY))->createStream($content);
    }
}