CoreFiles by mySites.guru
DebugBarTestCase.php47 lines, 1,213 bytes, from Joomla_4.1.3-rc1-Release_Candidate-Full_Package.zip
Raw History Compare with 4.1.1-rc2
md5
63a210a5d2cfee631d3c89b0a85bb954
sha1
5a1fb02b6a64118985625de300e3b35d261d54c3
sha256
5f94bfedcb3432c0080d279c47f9d5eaab32d0487468b4fe8245fe7f394f6dba
<?php

namespace DebugBar\Tests;

use DebugBar\DebugBar;
use DebugBar\RandomRequestIdGenerator;
use PHPUnit\Framework\TestCase;

abstract class DebugBarTestCase extends TestCase
{
    public function setUp(): void
    {
        $this->debugbar = new DebugBar();
        $this->debugbar->setHttpDriver($http = new MockHttpDriver());
    }

    public function assertJsonIsArray($json)
    {
        $data = json_decode($json);
        $this->assertTrue(is_array($data));
    }

    public function assertJsonIsObject($json)
    {
        $data = json_decode($json);
        $this->assertTrue(is_object($data));
    }

    public function assertJsonArrayNotEmpty($json)
    {
        $data = json_decode($json, true);
        $this->assertTrue(is_array($data) && !empty($data));
    }

    public function assertJsonHasProperty($json, $property)
    {
        $data = json_decode($json, true);
        $this->assertTrue(array_key_exists($property, $data));
    }

    public function assertJsonPropertyEquals($json, $property, $expected)
    {
        $data = json_decode($json, true);
        $this->assertTrue(array_key_exists($property, $data));
        $this->assertEquals($expected, $data[$property]);
    }
}

The same content is in 3 releases, Joomla 4.1.3-rc1 to 4.1.4-rc1. See them all, or every version of this file.