• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codeigniter4 / CodeIgniter4 / 14569795065

21 Apr 2025 07:55AM UTC coverage: 84.402% (+0.007%) from 84.395%
14569795065

Pull #9528

github

web-flow
Merge 4ad1f19d8 into 3d3ba0512
Pull Request #9528: feat: add Time::addCalendarMonths() function

11 of 11 new or added lines in 1 file covered. (100.0%)

136 existing lines in 21 files now uncovered.

20827 of 24676 relevant lines covered (84.4%)

191.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/system/Test/PhpStreamWrapper.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of CodeIgniter 4 framework.
7
 *
8
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace CodeIgniter\Test;
15

16
/**
17
 * StreamWrapper for php protocol
18
 *
19
 * This class is used for mocking `php://stdin`.
20
 *
21
 * See https://www.php.net/manual/en/class.streamwrapper.php
22
 */
23
final class PhpStreamWrapper
24
{
25
    /**
26
     * @var resource|null
27
     */
28
    public $context;
29

30
    private static string $content = '';
31
    private int $position          = 0;
32

33
    /**
34
     * @return void
35
     */
36
    public static function setContent(string $content)
37
    {
38
        self::$content = $content;
11✔
39
    }
40

41
    /**
42
     * @return void
43
     */
44
    public static function register()
45
    {
46
        stream_wrapper_unregister('php');
11✔
47
        stream_wrapper_register('php', self::class);
11✔
48
    }
49

50
    /**
51
     * @return void
52
     */
53
    public static function restore()
54
    {
55
        stream_wrapper_restore('php');
11✔
56
    }
57

58
    public function stream_open(): bool
59
    {
60
        return true;
11✔
61
    }
62

63
    /**
64
     * @return string
65
     */
66
    public function stream_read(int $count)
67
    {
68
        $return = substr(self::$content, $this->position, $count);
11✔
69
        $this->position += strlen($return);
11✔
70

71
        return $return;
11✔
72
    }
73

74
    /**
75
     * @return array{}
76
     */
77
    public function stream_stat()
78
    {
UNCOV
79
        return [];
×
80
    }
81

82
    public function stream_eof(): bool
83
    {
84
        return $this->position >= strlen(self::$content);
11✔
85
    }
86
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc