{"id":15022239,"url":"https://github.com/yegor256/phprack","last_synced_at":"2025-04-09T14:09:19.215Z","repository":{"id":8159470,"uuid":"9580744","full_name":"yegor256/phprack","owner":"yegor256","description":"phpRack Integration Testing Framework","archived":false,"fork":false,"pushed_at":"2025-03-25T00:06:08.000Z","size":1022,"stargazers_count":24,"open_issues_count":33,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T12:08:20.420Z","etag":null,"topics":["integration-testing","php","testing","vagrant"],"latest_commit_sha":null,"homepage":"www.phprack.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-21T14:43:29.000Z","updated_at":"2024-08-04T21:59:05.000Z","dependencies_parsed_at":"2023-10-04T11:11:52.180Z","dependency_job_id":"d56740f6-5469-481f-93c3-e3412de4fd7c","html_url":"https://github.com/yegor256/phprack","commit_stats":{"total_commits":610,"total_committers":12,"mean_commits":"50.833333333333336","dds":0.3590163934426229,"last_synced_commit":"65f119ccab7e129aa73d656c83bcec044a4cf04a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fphprack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fphprack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fphprack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fphprack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/phprack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054196,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["integration-testing","php","testing","vagrant"],"created_at":"2024-09-24T19:57:41.071Z","updated_at":"2025-04-09T14:09:19.196Z","avatar_url":"https://github.com/yegor256.png","language":"PHP","readme":"\u003cimg src=\"http://img.phprack.com/logo.png\" width=\"137px\" height=\"36px\"/\u003e\n\n[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/phprack)](http://www.rultor.com/p/yegor256/phprack)\n\n[![Build Status](https://travis-ci.org/yegor256/phprack.svg?branch=master)](https://travis-ci.org/yegor256/phprack)\n[![PDD status](http://www.0pdd.com/svg?name=yegor256/phprack)](http://www.0pdd.com/p?name=yegor256/phprack)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/phprack)](https://hitsofcode.com/view/github/yegor256/phprack)\n\nRead about phpRack in ​[php|Architect June 2010](http://www.phparch.com/magazine/2010/june/):\n\"Integration Testing with phpRack Framework\".\n\n**phpRack** is a light framework for automation of integration tests. By\nintegration tests we mean software modules that should be executed in the\nproduction environment, in order to validate that said environment is configured\nas expected. For example your product is a web2.0 application which depends on\nproper configuration of PHP, Apache, MySQL and availability of YouTube, Flickr\nand GoogleMaps API's. Your product is properly tested with unit tests (obviously\nyou're using stubs for said services and components). When the product is\ndeployed to the production environment, you want to be sure that the services\nyou need are configured and available. If they are not — you want to get a\nnotification about it before your end-users. And you want to get a detailed\nnotification.\n\n\u003cimg src=\"http://img.phprack.com/diagram.png\" style=\"width: 530px; height: 243px;\"/\u003e\n\nThis is when phpRack is mandatory. You shall add phpRack to your project, and\nwrite a number of tests. All these tests will be executed when requested and\nwill produce a detailed report, both only and by email. It will save you a lot\nof time during deployment and later, during maintenance of your product.\n\n## Quick Start\n\nTo start using phpRack you should do three operations:\n\n * Upload phpRack library to your server\n * Create `phprack.php` file in your `public_html` directory\n * Create PHP integration tests in your rack-tests directory\n\nLet's do them one by one:\n\n### Upload phpRack library\n\nDownload [ZIP archive](https://github.com/yegor256/phprack/archive/master.zip)\nof phpRach and unpack it to `public_html/phpRack` or some other directory on\nyour production server.\n\n### Create `phprack.php`\n\nYou should create `phprack.php` in your project's public directory\n(see [full reference](https://github.com/yegor256/phprack/wiki/Bootstrap)), e.g.:\n\n```php\n\u003c?php\n// this param is mandatory, others are optional\n$phpRackConfig = array(\n    'dir' =\u003e '../rack-tests',\n);\n// absolute path to the bootstrap script on your server\ninclude '../library/phpRack/bootstrap.php';\n```\n\n### Create integration tests\n\nWrite integration tests in the directory rack-tests, each one has to extend the\nclass `PhpRack_Test` (see\n[full list of assertions](https://github.com/yegor256/phprack/wiki/Assertions)).\nFor example, file `MyTest.php`:\n\n```php\n\u003c?php\nclass MyTest extends phpRack_Test\n{\n    public function testPhpVersionIsCorrect()\n    {\n        $this-\u003eassert-\u003ephp-\u003eversion\n            -\u003eatLeast('5.2');\n    }\n    public function testPhpExtensionsExist()\n    {\n        $this-\u003eassert-\u003ephp-\u003eextensions\n            -\u003eisLoaded('xsl')\n            -\u003eisLoaded('simplexml')\n            -\u003eisLoaded('fileinfo');\n    }\n}\n```\n\nGo to this URL: `http://your-website-url/phprack.php` and enjoy. Try this link\nto see what you're going to see on your site:\n​[http://www.phprack.com/phprack.php](http://www.phprack.com/phprack.php).\n\n## How to contribute?\n\nFirst, fork our repository and clone it to your local machine and install\n[Vagrant](http://www.vagrantup.com/). Then, run:\n\n\u003e vagrant up\n\nA virtual machine with pre-installed requisites will be ready in a few\nminutes. Login to it and go to `/vagrant` directory:\n\n\u003e vagrant ssh\n\nThen, in the virtual machine run:\n\n\u003e phing\n\nAll tests should pass. If you see any problems, please submit an\nnew issue to us.\n\nAfter you make your changes don't forget to run `phing` again to make\nsure you didn't break anything. When ready, submit a pull request.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fphprack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fphprack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fphprack/lists"}