Skip to content

Commit

Permalink
[9.x] add test for traituserecursive, append_config in helper (#44534)
Browse files Browse the repository at this point in the history
* [9.x] add test for traituserecursive, append_config in helper

* fix style
  • Loading branch information
moharami authored Oct 10, 2022
1 parent b0c7a81 commit 6e02bd2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Support/SupportHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,17 @@ public function testClassUsesRecursiveReturnParentTraitsFirst()
class_uses_recursive(SupportTestClassThree::class));
}

public function testTraitUsesRecursive()
{
$this->assertSame([
'Illuminate\Tests\Support\SupportTestTraitTwo' => 'Illuminate\Tests\Support\SupportTestTraitTwo',
'Illuminate\Tests\Support\SupportTestTraitOne' => 'Illuminate\Tests\Support\SupportTestTraitOne',
],
trait_uses_recursive(SupportTestClassOne::class));

$this->assertSame([], trait_uses_recursive(SupportTestClassTwo::class));
}

public function testStr()
{
$stringable = str('string-value');
Expand Down Expand Up @@ -764,6 +775,15 @@ public function testWith()
}));
}

public function testAppendConfig()
{
$this->assertSame([10000 => 'name', 10001 => 'family'], append_config([1 => 'name', 2 => 'family']));
$this->assertSame([10000 => 'name', 10001 => 'family'], append_config(['name', 'family']));

$array = ['name' => 'Taylor', 'family' => 'Otwell'];
$this->assertSame($array, append_config($array));
}

public function testEnv()
{
$_SERVER['foo'] = 'bar';
Expand Down

0 comments on commit 6e02bd2

Please sign in to comment.