Skip to content

Commit

Permalink
Tiny doesn't support PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jan 29, 2021
1 parent 3d1c0a3 commit a770d91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/TestCase/Model/Behavior/ObfuscateBehaviorTest.php
Expand Up @@ -6,6 +6,7 @@
use Cake\ORM\Entity;
use Cake\TestSuite\TestCase;
use InvalidArgumentException;
use Muffin\Obfuscate\Model\Behavior\Strategy\StrategyInterface;
use Muffin\Obfuscate\Model\Behavior\Strategy\TinyStrategy;
use Muffin\Obfuscate\Model\Behavior\Strategy\UuidStrategy;

Expand Down Expand Up @@ -55,9 +56,16 @@ public function setUp(): void

$this->Comments = $this->getTableLocator()->get('Muffin/Obfuscate.Comments', ['table' => 'obfuscate_comments']);

$strategy = $this->getMockBuilder(StrategyInterface::class)
->getMock();
$strategy->method('obfuscate')
->willReturn('S');
$strategy->method('elucidate')
->willReturn(1);

$this->Tags = $this->getTableLocator()->get('Muffin/Obfuscate.Tags', ['table' => 'obfuscate_tags']);
$this->Tags->addBehavior('Muffin/Obfuscate.Obfuscate', [
'strategy' => new TinyStrategy('5SX0TEjkR1mLOw8Gvq2VyJxIFhgCAYidrclDWaM3so9bfzZpuUenKtP74QNH6B'),
'strategy' => $strategy,
]);

$this->Articles = $this->getTableLocator()->get('Muffin/Obfuscate.Articles', ['table' => 'obfuscate_articles']);
Expand Down
4 changes: 3 additions & 1 deletion tests/TestCase/Model/Behavior/Strategy/TinyStrategyTest.php
Expand Up @@ -3,8 +3,8 @@

namespace Muffin\Obfuscate\Test\TestCase\Model\Behavior\Strategy;

use Cake\TestSuite\TestCase;
use Muffin\Obfuscate\Model\Behavior\Strategy\TinyStrategy;
use PHPUnit\Framework\TestCase;

class TinyStrategyTest extends TestCase
{
Expand All @@ -15,6 +15,8 @@ class TinyStrategyTest extends TestCase

public function setUp(): void
{
$this->skipIf(PHP_VERSION_ID >= 80000, 'Tiny doesn\'t have PHP 8 support');

$this->strategy = new TinyStrategy('5SX0TEjkR1mLOw8Gvq2VyJxIFhgCAYidrclDWaM3so9bfzZpuUenKtP74QNH6B');
}

Expand Down

0 comments on commit a770d91

Please sign in to comment.