Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to CakePHP 4 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Froala WYSIWYG Editor Plugin for CakePHP 3
# Froala WYSIWYG Editor Plugin for CakePHP 4

[![Packagist](https://img.shields.io/packagist/v/froala/wysiwyg-cake.svg)](https://packagist.org/packages/froala/wysiwyg-cake)
[![Packagist](https://img.shields.io/packagist/dt/froala/wysiwyg-cake.svg)](https://packagist.org/packages/froala/wysiwyg-cake)

> CakePHP Plugin for Froala Javascript WYSIWYG Text Editor. For CakePHP >=3.0.
> CakePHP Plugin for Froala Javascript WYSIWYG Text Editor. For CakePHP >=4.0.

> See [froala/wysiwyg-cake](https://github.com/froala/wysiwyg-cake) for CakePHP version 3.

> See [froala/wysiwyg-cake2](https://github.com/froala/wysiwyg-cake2) for CakePHP version 2.

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "cakephp-plugin",
"keywords": [
"froala",
"froala cake php 3",
"froala cake php 4",
"html",
"text",
"editor",
Expand All @@ -24,8 +24,8 @@
}
],
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": ">=3.3.2 <4.0.0",
"php": ">=7.1",
"cakephp/cakephp": "^4.0.0",
"fortawesome/font-awesome": ">=4.4.0"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions config/routes.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;

Router::plugin(
/** @var \Cake\Routing\RouteBuilder $routes */
$routes->plugin(
'Froala',
['path' => '/froala'],
function (RouteBuilder $routes) {
Expand Down
60 changes: 19 additions & 41 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="Froala Test Suite">
<directory>./tests/TestCase</directory>
</testsuite>
</testsuites>

<!-- Setup a listener for fixtures -->
<listeners>
<listener
class="\Cake\TestSuite\Fixture\FixtureInjector"
file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
<arguments>
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
</arguments>
</listener>
</listeners>

<!-- Prevent coverage reports from looking in tests and vendors -->
<filter>
<blacklist>
<directory suffix=".php">./vendor/</directory>
<directory suffix=".ctp">./vendor/</directory>

<directory suffix=".php">./tests/</directory>
<directory suffix=".ctp">./tests/</directory>
</blacklist>
</filter>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>
<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="Froala Test Suite">
<directory>tests/TestCase/</directory>
</testsuite>
</testsuites>
<extensions>
<extension class="\Cake\TestSuite\Fixture\PHPUnitExtension"/>
</extensions>
</phpunit>
2 changes: 1 addition & 1 deletion src/View/Helper/FroalaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FroalaHelper extends Helper
public $helpers = array('Html');


public function initialize(array $config) {}
public function initialize(array $config): void {}

/**
* Adds a new editor to the script block on the page
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/View/Helper/FroalaHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FroalaHelperTest extends TestCase
*
* @return void
*/
public function setUp()
public function setUp(): void
{
parent::setUp();
$view = new View();
Expand All @@ -35,7 +35,7 @@ public function setUp()
*
* @return void
*/
public function tearDown()
public function tearDown(): void
{
unset($this->Froala);

Expand Down
18 changes: 17 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);

/**
* Test suite bootstrap for Froala.
*
Expand All @@ -21,4 +23,18 @@
unset($findRoot);

chdir($root);
require $root . '/config/bootstrap.php';

require_once $root . '/vendor/autoload.php';

/**
* Define fallback values for required constants and configuration.
* To customize constants and configuration remove this require
* and define the data required by your plugin here.
*/
require_once $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';

if (file_exists($root . '/config/bootstrap.php')) {
require $root . '/config/bootstrap.php';

return;
}