Basic library for any project and dependence library for anothers diamond projects.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You need have Composer to install Diamond.
$ composer require diverproject/diamond-lang "^3.0"
To execute all test cases (or suite) you need PHP Unit
$ phpunit
- Set system environment, this can apply different reactions, see wiki classes affected by this setting or classes documentation. For example, when running PHP Unit, enable
ENVIRONMENT_TEST_CASE
and usingdiamond\test\lang\AbstractDiamondTest
Diamond::setEnvironment(Diamond::ENVIRONMENT_HOMOLOG); // Options: ENVIRONMENT_HOMOLOG, ENVIRONMENT_TEST_CASE or ENVIRONMENT_PRODUCTION
- Set throws exceptions from parsing methods into different classes, see wiki methods affected by this setting or methods documentation. When enabled, parsing failures will throws a Exception otherwise will return
NULL
or a default value if it's possible. Some cases a default value don't help treat the problem them will returnNULL
.
Diamond::setEnabledParseThrows(TRUE); // Options: TRUE or FALSE
That's it, don't forget include
library when use composer like include 'vendor/autoload.php
(will depend of your system file structure)
The test scripts are located on test
root folder.
First all update dependences libraries and generate vendor autoload
of composer:
$ composer update
or if you are in Windows execute 'composer-update.bat' (it's more easy) - it's same think as above
Now you can execute PHP Unit
and check tests results, there are 2 ways:
The first way and more easy is execute phpunit.bat
; check the content file to understand and if you didn't know PHP Unit
check this link here.
The second way is work only if you open the project into Eclipse PHP
, setting PHP Unit Preferences
and running individual scripts or selecting one or more and running.
Some classes will not have a tests scripts because need something else to work, like Cookie
, Get
, Post
and Session
classes into diamond\lang\http
.
And if you see some problemns or classes without tests scripts tell us.
DON'T FORGET change setting your environment system running type to
Diamond::setEnvironment(Diamond::ENVIRONMENT_PRODUCTION);
- Composer - Dependency Manager Framework
We use SemVer for versioning. For the versions available, see the tags on this repository.
The revision log have somethings different because it's used developers found more easy changes made and make github commit messages more clean.
- Andrew Mello da Silva - Developer - Driw
This project is licensed under the MIT License - see the LICENSE.md file for details
- Billie Thompson - Readme template - PurpleBooth