silviooosilva /
CacheerPHP
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | use PHPUnit\Framework\TestCase; |
||||||
| 4 | use Silviooosilva\CacheerPhp\Cacheer; |
||||||
| 5 | use Silviooosilva\CacheerPhp\Config\Option\Builder\OptionBuilder; |
||||||
| 6 | |||||||
| 7 | final class StaticAccessTest extends TestCase |
||||||
| 8 | { |
||||||
| 9 | public function testFlushCacheStatic(): void |
||||||
| 10 | { |
||||||
| 11 | $result = Cacheer::flushCache(); |
||||||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||||||
| 12 | $this->assertIsBool($result); |
||||||
| 13 | } |
||||||
| 14 | |||||||
| 15 | public function testFlushCacheDynamic(): void |
||||||
| 16 | { |
||||||
| 17 | $cache = new Cacheer(); |
||||||
| 18 | $this->assertIsBool($cache->flushCache()); |
||||||
| 19 | } |
||||||
| 20 | |||||||
| 21 | public function testSetUp(): void |
||||||
| 22 | { |
||||||
| 23 | $cache = new Cacheer(); |
||||||
| 24 | $options = [ |
||||||
| 25 | 'driver' => 'file', |
||||||
| 26 | 'path' => '/tmp/cache', |
||||||
| 27 | ]; |
||||||
| 28 | $cache->setUp($options); |
||||||
| 29 | $this->assertSame($options, $cache->options); |
||||||
| 30 | } |
||||||
| 31 | |||||||
| 32 | public static function testSetUpStatic(): void |
||||||
| 33 | { |
||||||
| 34 | $options = [ |
||||||
| 35 | 'driver' => 'file', |
||||||
| 36 | 'path' => '/tmp/cache', |
||||||
| 37 | ]; |
||||||
| 38 | Cacheer::setUp($options); |
||||||
|
0 ignored issues
–
show
The method
Silviooosilva\CacheerPhp\Cacheer::setUp() is not static, but was called statically.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 39 | self::assertSame($options, Cacheer::getOptions()); |
||||||
|
0 ignored issues
–
show
The method
Silviooosilva\CacheerPhp\Cacheer::getOptions() is not static, but was called statically.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 40 | } |
||||||
| 41 | |||||||
| 42 | public function testSetUpStaticWithOptionBuilder(): void |
||||||
| 43 | { |
||||||
| 44 | $options = OptionBuilder::forFile() |
||||||
| 45 | ->dir('/tmp/cache') |
||||||
| 46 | ->flushAfter()->hour(2) |
||||||
| 47 | ->build(); |
||||||
| 48 | |||||||
| 49 | Cacheer::setUp($options); |
||||||
|
0 ignored issues
–
show
The method
Silviooosilva\CacheerPhp\Cacheer::setUp() is not static, but was called statically.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 50 | self::assertSame($options, Cacheer::getOptions()); |
||||||
|
0 ignored issues
–
show
The method
Silviooosilva\CacheerPhp\Cacheer::getOptions() is not static, but was called statically.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 51 | } |
||||||
| 52 | } |