From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../vendor/react/promise/tests/LazyPromiseTest.php | 107 --------------------- 1 file changed, 107 deletions(-) delete mode 100755 assets/php/vendor/react/promise/tests/LazyPromiseTest.php (limited to 'assets/php/vendor/react/promise/tests/LazyPromiseTest.php') diff --git a/assets/php/vendor/react/promise/tests/LazyPromiseTest.php b/assets/php/vendor/react/promise/tests/LazyPromiseTest.php deleted file mode 100755 index b630881..0000000 --- a/assets/php/vendor/react/promise/tests/LazyPromiseTest.php +++ /dev/null @@ -1,107 +0,0 @@ -promise(); - }; - - return new CallbackPromiseAdapter([ - 'promise' => function () use ($factory) { - return new LazyPromise($factory); - }, - 'resolve' => [$d, 'resolve'], - 'reject' => [$d, 'reject'], - 'notify' => [$d, 'progress'], - 'settle' => [$d, 'resolve'], - ]); - } - - /** @test */ - public function shouldNotCallFactoryIfThenIsNotInvoked() - { - $factory = $this->createCallableMock(); - $factory - ->expects($this->never()) - ->method('__invoke'); - - new LazyPromise($factory); - } - - /** @test */ - public function shouldCallFactoryIfThenIsInvoked() - { - $factory = $this->createCallableMock(); - $factory - ->expects($this->once()) - ->method('__invoke'); - - $p = new LazyPromise($factory); - $p->then(); - } - - /** @test */ - public function shouldReturnPromiseFromFactory() - { - $factory = $this->createCallableMock(); - $factory - ->expects($this->once()) - ->method('__invoke') - ->will($this->returnValue(new FulfilledPromise(1))); - - $onFulfilled = $this->createCallableMock(); - $onFulfilled - ->expects($this->once()) - ->method('__invoke') - ->with($this->identicalTo(1)); - - $p = new LazyPromise($factory); - - $p->then($onFulfilled); - } - - /** @test */ - public function shouldReturnPromiseIfFactoryReturnsNull() - { - $factory = $this->createCallableMock(); - $factory - ->expects($this->once()) - ->method('__invoke') - ->will($this->returnValue(null)); - - $p = new LazyPromise($factory); - $this->assertInstanceOf('React\\Promise\\PromiseInterface', $p->then()); - } - - /** @test */ - public function shouldReturnRejectedPromiseIfFactoryThrowsException() - { - $exception = new \Exception(); - - $factory = $this->createCallableMock(); - $factory - ->expects($this->once()) - ->method('__invoke') - ->will($this->throwException($exception)); - - $onRejected = $this->createCallableMock(); - $onRejected - ->expects($this->once()) - ->method('__invoke') - ->with($this->identicalTo($exception)); - - $p = new LazyPromise($factory); - - $p->then($this->expectCallableNever(), $onRejected); - } -} -- cgit v1.2.3