-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from cakephp/issue-7062
Correct plugin generation for vendored plugins.
- Loading branch information
Showing
12 changed files
with
153 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Company/Example plugin for CakePHP | ||
|
||
## Installation | ||
|
||
You can install this plugin into your CakePHP application using [composer](http://getcomposer.org). | ||
|
||
The recommended way to install composer packages is: | ||
|
||
``` | ||
composer require Company/Example | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "Company/Example", | ||
"description": "Company/Example plugin for CakePHP", | ||
"type": "cakephp-plugin", | ||
"require": { | ||
"php": ">=5.4.16", | ||
"cakephp/cakephp": "~3.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Company\\Example\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Company\\Example\\Test\\": "tests", | ||
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
use Cake\Routing\Router; | ||
|
||
Router::plugin('Company/Example', function ($routes) { | ||
$routes->fallbacks('InflectedRoute'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?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="Company/Example 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> |
10 changes: 10 additions & 0 deletions
10
tests/comparisons/Plugin/Company/Example/src/Controller/AppController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Company\Example\Controller; | ||
|
||
use App\Controller\AppController as BaseController; | ||
|
||
class AppController extends BaseController | ||
{ | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
tests/comparisons/Plugin/Company/Example/tests/bootstrap.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* Test suite bootstrap for Company/Example. | ||
* | ||
* This function is used to find the location of CakePHP whether CakePHP | ||
* has been installed as a dependency of the plugin, or the plugin is itself | ||
* installed as a dependency of an application. | ||
*/ | ||
$findRoot = function ($root) { | ||
do { | ||
$lastRoot = $root; | ||
$root = dirname($root); | ||
if (is_dir($root . '/vendor/cakephp/cakephp')) { | ||
return $root; | ||
} | ||
} while ($root !== $lastRoot); | ||
|
||
throw new Exception("Cannot find the root of the application, unable to run tests"); | ||
}; | ||
$root = $findRoot(__FILE__); | ||
unset($findRoot); | ||
|
||
chdir($root); | ||
require $root . '/config/bootstrap.php'; |
Empty file.