# wp-stateless/2.1.4/lib/Google/vendor/react/promise/tests/FunctionRejectTest.php

WP-Stateless – Google Cloud Storage, version 2.1.4. 65 lines.

- Page: https://pluginprobe.com/plugins/wp-stateless/2.1.4/code/lib/Google/vendor/react/promise/tests/FunctionRejectTest.php
- Raw: https://pluginprobe.com/plugins/wp-stateless/2.1.4/raw/lib/Google/vendor/react/promise/tests/FunctionRejectTest.php
- Modified: 2018-04-06T08:15:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-stateless/2.1.4/code/lib/Google/vendor/react/promise/tests/FunctionRejectTest.php#L10-L20`.

```php
<?php

namespace React\Promise;

class FunctionRejectTest extends TestCase
{
    /** @test */
    public function shouldRejectAnImmediateValue()
    {
        $expected = 123;

        $mock = $this->createCallableMock();
        $mock
            ->expects($this->once())
            ->method('__invoke')
            ->with($this->identicalTo($expected));

        reject($expected)
            ->then(
                $this->expectCallableNever(),
                $mock
            );
    }

    /** @test */
    public function shouldRejectAFulfilledPromise()
    {
        $expected = 123;

        $resolved = new FulfilledPromise($expected);

        $mock = $this->createCallableMock();
        $mock
            ->expects($this->once())
            ->method('__invoke')
            ->with($this->identicalTo($expected));

        reject($resolved)
            ->then(
                $this->expectCallableNever(),
                $mock
            );
    }

    /** @test */
    public function shouldRejectARejectedPromise()
    {
        $expected = 123;

        $resolved = new RejectedPromise($expected);

        $mock = $this->createCallableMock();
        $mock
            ->expects($this->once())
            ->method('__invoke')
            ->with($this->identicalTo($expected));

        reject($resolved)
            ->then(
                $this->expectCallableNever(),
                $mock
            );
    }
}

```
