<?php
use Laminas\Stdlib\ArrayUtils;
use PHPUnit\Framework\TestCase;
/**
* The class to test
*/
class Foo
{
public function mergeAndFoo(array $array1, array $array2)
{
$merged = ArrayUtils::merge($array1, $array2);
$merged[] = 'foo';
return $merged;
}
}
class Static2Test extends TestCase
{
public function testMergeAndFoo() : void
{
$mock = Mockery::mock('alias:' . ArrayUtils::CLASS);
$mock->shouldReceive('merge')
->andReturn([]);
$array1 = ['bar', 'baz'];
$array2 = [100, 200];
$foo = new Foo();
$actual = $foo->mergeAndFoo($array1, $array2);
$this->assertEquals(['foo'], $actual);
}
protected function tearDown() : void
{
Mockery::close();
}
}