This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
137 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Running Tests | ||
|
||
## Prerequisites | ||
|
||
### PHPUnit | ||
Unit tests use PHPUnit framework (see http://www.phpunit.de for more information). PHPUnit can be installed via Composer together with other development dependencies using the following command from the command line. | ||
|
||
``` | ||
php composer install --dev | ||
``` | ||
|
||
If you don't have composer, you need to install it: | ||
1. [Get Composer and Follow Installation instructions here](https://getcomposer.org/download ) | ||
2. Be sure to [install Composer **globally**](https://getcomposer.org/doc/00-intro.md#globally): `mv composer.phar /usr/local/bin/composer` | ||
|
||
## Running | ||
|
||
Once the prerequisites are installed, run the tests from the project root directory: | ||
|
||
``` | ||
vendor/bin/phpunit | ||
``` | ||
|
||
|
||
If the tests are successful, you should see something similar to this. Otherwise, the errors will be displayed. | ||
``` | ||
PHPUnit 5.4.8-2-g44c37e0 by Sebastian Bergmann and contributors. | ||
. 1 / 1 (100%) | ||
Time: 41 ms, Memory: 3.75MB | ||
OK (1 test, 18 assertions) | ||
``` | ||
|
||
# Running test coverage report | ||
|
||
``` | ||
vendor/bin/phpunit --coverage-html _meta/coverage | ||
``` | ||
|
||
Report will be available in _meta/coverage/index.html |
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,50 @@ | ||
# Style guide for contributing | ||
|
||
## PHP | ||
|
||
All PHP contributions must adhere to [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/) specifications. | ||
|
||
In addition: | ||
|
||
### Documentation | ||
|
||
- All documentation blocks must adhere to the [PHPDoc](https://phpdoc.org/) format and syntax. | ||
- All PHP files MUST contain the following documentation block immediately after the opening `<?php` tag: | ||
|
||
``` | ||
/** | ||
* UserFrosting Assets (http://www.userfrosting.com) | ||
* | ||
* @link https://github.com/userfrosting/assets | ||
* @copyright Copyright (c) 2013-2019 Alexander Weissman, Jordan Mele | ||
* @license https://github.com/userfrosting/assets/blob/master/LICENSE.md (MIT License) | ||
*/ | ||
``` | ||
|
||
### Classes | ||
|
||
- All classes MUST be prefaced with a documentation block containing a description and the author(s) of that class. You SHOULD add other descriptive properties as well. | ||
- All class members and methods MUST be prefaced with a documentation block. Any parameters and return values MUST be documented. | ||
- The contents of a class should be organized in the following order: constants, member variables, constructor, other magic methods, public methods, protected methods, private methods. | ||
- Within each of the categories above, variables/methods should be alphabetized. See http://stackoverflow.com/a/3366429/2970321. | ||
- Setter methods SHOULD return the parent object. | ||
|
||
### Variables | ||
|
||
- All class member variables and local variables MUST be declared in `camelCase`. | ||
|
||
### Arrays | ||
|
||
- Array keys MUST be defined using `snake_case`. This is so they can be referenced in Twig and other templating languages. | ||
- Array keys MUST NOT contain `.`. This is because `.` is a reserved operator in Laravel and Twig's [dot syntax](https://medium.com/@assertchris/dot-notation-3fd3e42edc61). | ||
- Multidimensional arrays SHOULD be referenced using dot syntax whenever possible. So, instead of doing `$myArray['person1']['email']`, you should use `$myArray['person1.email']` if your array structure supports it. | ||
|
||
## Automatically fixing coding style with PHP-CS-Fixer | ||
|
||
[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) can be used to automatically fix PHP code styling. UserFrosting provides a project specific configuration file ([`.php_cs`](.php_cs)) with a set of rules reflecting our style guidelines. This tool should be used before submitting any code change to assure the style guidelines are met. Every sprinkles will also be parsed by the fixer. | ||
|
||
PHP-CS-Fixer is automatically loaded by Composer and can be used from the UserFrosting root directory : | ||
|
||
``` | ||
vendor/bin/php-cs-fixer fix | ||
``` |
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
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