2023-01-15 21:31:19 +00:00
|
|
|
<?php
|
2024-08-24 12:31:41 +00:00
|
|
|
|
|
|
|
// Copyright (C) 2010-2024, the Friendica project
|
|
|
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
2023-01-15 21:31:19 +00:00
|
|
|
|
|
|
|
namespace Friendica\Test\Util\Hooks\InstanceMocks;
|
|
|
|
|
|
|
|
class FakeInstanceDecorator implements IAmADecoratedInterface
|
|
|
|
{
|
|
|
|
public static $countInstance = 0;
|
|
|
|
|
2023-07-16 22:10:15 +00:00
|
|
|
const PREFIX = 'prefix1';
|
|
|
|
|
2023-01-15 21:31:19 +00:00
|
|
|
/** @var IAmADecoratedInterface */
|
|
|
|
protected $orig;
|
|
|
|
|
2023-07-16 22:10:15 +00:00
|
|
|
public function __construct(IAmADecoratedInterface $orig)
|
2023-01-15 21:31:19 +00:00
|
|
|
{
|
|
|
|
$this->orig = $orig;
|
|
|
|
|
|
|
|
self::$countInstance++;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function createSomething(string $aText, bool $cBool, string $bText): string
|
|
|
|
{
|
|
|
|
return $this->orig->createSomething($aText, $cBool, $bText);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAText(): ?string
|
|
|
|
{
|
2023-07-16 22:10:15 +00:00
|
|
|
return static::PREFIX . $this->orig->getAText();
|
2023-01-15 21:31:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getBText(): ?string
|
|
|
|
{
|
2023-07-16 22:10:15 +00:00
|
|
|
return static::PREFIX . $this->orig->getBText();
|
2023-01-15 21:31:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getCBool(): ?bool
|
|
|
|
{
|
2023-07-16 22:10:15 +00:00
|
|
|
return static::PREFIX . $this->orig->getCBool();
|
2023-01-15 21:31:19 +00:00
|
|
|
}
|
|
|
|
}
|