aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/php/vendor/react/cache/tests
diff options
context:
space:
mode:
Diffstat (limited to 'assets/php/vendor/react/cache/tests')
-rwxr-xr-xassets/php/vendor/react/cache/tests/ArrayCacheTest.php60
-rwxr-xr-xassets/php/vendor/react/cache/tests/CallableStub.php10
-rwxr-xr-xassets/php/vendor/react/cache/tests/TestCase.php43
3 files changed, 0 insertions, 113 deletions
diff --git a/assets/php/vendor/react/cache/tests/ArrayCacheTest.php b/assets/php/vendor/react/cache/tests/ArrayCacheTest.php
deleted file mode 100755
index eec3739..0000000
--- a/assets/php/vendor/react/cache/tests/ArrayCacheTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-namespace React\Tests\Cache;
-
-use React\Cache\ArrayCache;
-
-class ArrayCacheTest extends TestCase
-{
- private $cache;
-
- public function setUp()
- {
- $this->cache = new ArrayCache();
- }
-
- /** @test */
- public function getShouldRejectPromiseForNonExistentKey()
- {
- $this->cache
- ->get('foo')
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableOnce()
- );
- }
-
- /** @test */
- public function setShouldSetKey()
- {
- $this->cache
- ->set('foo', 'bar');
-
- $success = $this->createCallableMock();
- $success
- ->expects($this->once())
- ->method('__invoke')
- ->with('bar');
-
- $this->cache
- ->get('foo')
- ->then($success);
- }
-
- /** @test */
- public function removeShouldRemoveKey()
- {
- $this->cache
- ->set('foo', 'bar');
-
- $this->cache
- ->remove('foo');
-
- $this->cache
- ->get('foo')
- ->then(
- $this->expectCallableNever(),
- $this->expectCallableOnce()
- );
- }
-}
diff --git a/assets/php/vendor/react/cache/tests/CallableStub.php b/assets/php/vendor/react/cache/tests/CallableStub.php
deleted file mode 100755
index 2f547cd..0000000
--- a/assets/php/vendor/react/cache/tests/CallableStub.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-namespace React\Tests\Cache;
-
-class CallableStub
-{
- public function __invoke()
- {
- }
-}
diff --git a/assets/php/vendor/react/cache/tests/TestCase.php b/assets/php/vendor/react/cache/tests/TestCase.php
deleted file mode 100755
index aa449f2..0000000
--- a/assets/php/vendor/react/cache/tests/TestCase.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-namespace React\Tests\Cache;
-
-use PHPUnit\Framework\TestCase as BaseTestCase;
-
-class TestCase extends BaseTestCase
-{
- protected function expectCallableExactly($amount)
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->exactly($amount))
- ->method('__invoke');
-
- return $mock;
- }
-
- protected function expectCallableOnce()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->once())
- ->method('__invoke');
-
- return $mock;
- }
-
- protected function expectCallableNever()
- {
- $mock = $this->createCallableMock();
- $mock
- ->expects($this->never())
- ->method('__invoke');
-
- return $mock;
- }
-
- protected function createCallableMock()
- {
- return $this->getMockBuilder('React\Tests\Cache\CallableStub')->getMock();
- }
-}