Completed
Pull Request — master (#27)
by Harry
06:09
created

TestCase::setUp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
1
<?php
2
/**
3
 * This file is part of graze/gigya-client
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/gigya-client/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/gigya-client
12
 */
13
14
namespace Graze\Gigya\Test;
15
16
use GuzzleHttp\Psr7\Stream;
17
18
class TestCase extends \PHPUnit_Framework_TestCase
19
{
20
    public function setUp()
21
    {
22
        if ('' === ini_get('date.timezone')) {
23
            date_default_timezone_set('UTC');
24
        }
25
    }
26
27
    /**
28
     * @param string $text
29
     *
30
     * @return Stream
31
     */
32
    protected function toStream($text)
33
    {
34
        $stream = fopen('php://temp', 'a+');
35
        fwrite($stream, $text);
36
        rewind($stream);
37
        return new Stream($stream);
38
    }
39
}
40