PHP Classes

File: tests/ParameterHelper.php

Recommend this page to a friend!
  Packages of Rodolfo Berrios Arce   Parameter   tests/ParameterHelper.php   Download  
File: tests/ParameterHelper.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Parameter
Validate function parameters with PHP attributes
Author: By
Last change:
Date: 1 year ago
Size: 912 bytes
 

Contents

Class file image Download
<?php

/*
 * This file is part of Chevere.
 *
 * (c) Rodolfo Berrios <rodolfo@chevere.org>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Chevere\Tests;

use PHPUnit\Framework\TestCase;

class ParameterHelper extends TestCase
{
    public function __construct()
    {
        parent::__construct(__CLASS__);
    }

    public function testWithParameterDefault(
        string $primitive,
        object $parameter,
        mixed $default,
        object $parameterWithDefault
    ): void {
        $this->assertNotSame($parameter, $parameterWithDefault);
        $this->assertSame($default, $parameterWithDefault->default());
        $this->assertSame($default, $parameterWithDefault->default());
        $this->assertSame($primitive, $parameterWithDefault->type()->primitive());
    }
}