PHPackages                             yipl/hookah - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. yipl/hookah

ActiveLibrary[Testing &amp; Quality](/categories/testing)

yipl/hookah
===========

A smoke test library with PHPUnit

1.6.25(9y ago)151.5k5MITPHPPHP &gt;=5.6

Since Aug 19Pushed 7y ago6 watchersCompare

[ Source](https://github.com/younginnovations/hookah)[ Packagist](https://packagist.org/packages/yipl/hookah)[ RSS](/packages/yipl-hookah/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (28)Used By (0)

Hookah
======

[](#hookah)

Remember the baaje le tanne hookah? We do remember it at [YIPL](http://yipl.com.np).

[![Hookah Smoke tests](https://cloud.githubusercontent.com/assets/170554/10163666/811c4604-66c5-11e5-9335-41abc5dd1054.png "Hookah Smoke tests")](https://cloud.githubusercontent.com/assets/170554/10163666/811c4604-66c5-11e5-9335-41abc5dd1054.png)

Hookah is a small [smoke testing](https://en.wikipedia.org/wiki/Smoke_testing_(software)) command line library for any web application. As it is just a sanity check it checks if the given URL returns back the right response code, and body is not empty. By the time you listen to this [hookah mero song](https://youtu.be/Ch55A5XyzVE) by Karma band the test would usually finish running. Basically it is like the baaje (grandfather) in the above picture testing your application, he does not know to click stuff, fill form etc he just says did he see content or a white page. That's smoke testing for you.

If you wish to do other behavior level testing then [Behat](http://behat.org)/[Mink](http://mink.behat.org/en/latest/) or [CasperJs](http://casperjs.org/) can be used.

Build Status
------------

[](#build-status)

It does not have tests for itself but it will check one of the websites provided in config. For example a Drupal 7 test installation status is below:

[![Build Status](https://camo.githubusercontent.com/69b0d20a47565cdbc20ad566beb219a04d709971cf18ba3e9a46dfd1068357ee/68747470733a2f2f7472617669732d63692e6f72672f796f756e67696e6e6f766174696f6e732f686f6f6b61682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/younginnovations/hookah)

Code Quality
------------

[](#code-quality)

Code quality is analyzed on CodeClimate.

[![Code Climate](https://camo.githubusercontent.com/355aecdc8a8ac334d401b1f362ce4fb617bdac10c719b1078c65991de7952f88/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f796f756e67696e6e6f766174696f6e732f686f6f6b61682f6261646765732f6770612e737667)](https://codeclimate.com/github/younginnovations/hookah)

Prerequisites
-------------

[](#prerequisites)

You will need PHP installed on your system and have composer running, the package depends on [PHPUnit](https://phpunit.de/)and [Goutte](https://github.com/FriendsOfPHP/Goutte) 2.x. Goutte depends on [Guzzle](http://guzzle.readthedocs.org/en/latest/).

Install
-------

[](#install)

Hookah can be cloned after from this github repository and installed following the procedure given below:

- git clone :younginnovations/hookah.git
- cd hookah
- composer install --prefer-dist

Use with other projects
-----------------------

[](#use-with-other-projects)

You can use hookah with other projects, it is available on [packagist](http://bit.ly/1LiDppx) and you can get it using composer. The following ways:

### With composer require

[](#with-composer-require)

You can run composer require like the following to get hookah added to your composer.json file:

```
composer require --dev yipl/hookah

```

### Add hookah to your composer.json file

[](#add-hookah-to-your-composerjson-file)

You can even add the following to your `composer.json` in the `require-dev` part:

```
	"yipl/hookah":	"~0.4"

```

If you want to use goutte ~3.1 use the following version:

```
    "yipl/hookah":  "~0.5"

```

If you want to use phpunit ~5.1 (which requires PHP 5.6 or above) use the following version:

```
    "yipl/hookah":  "~0.6"

```

Run
---

[](#run)

The app can be run with the command below:

- install the application dependencies using command: `composer install`
- then run `./vendor/bin/phpunit`

It should pass like below given you have internet :)

[![Hookah Smoke tests passing](https://camo.githubusercontent.com/075f082873660375245667355719e6d8feed5666ace57f1ec764239efe70af5c/68747470733a2f2f73332d61702d736f757468656173742d312e616d617a6f6e6177732e636f6d2f75706c6f6164732d61702e686970636861742e636f6d2f3134303236312f313334333037302f655779786f424642793151766e4b312f686f6f6b61682d70617373696e6730312e706e67 "Hookah Smoke tests passing")](https://camo.githubusercontent.com/075f082873660375245667355719e6d8feed5666ace57f1ec764239efe70af5c/68747470733a2f2f73332d61702d736f757468656173742d312e616d617a6f6e6177732e636f6d2f75706c6f6164732d61702e686970636861742e636f6d2f3134303236312f313334333037302f655779786f424642793151766e4b312f686f6f6b61682d70617373696e6730312e706e67)

How fast it runs will depend on your internet speed as it tries to get around 7 URLs from this [test](http://drupal-test.jelastic.elastx.net/) Drupal 7 installation.

Run tests faster
----------------

[](#run-tests-faster)

You can run the tests faster with [paratest](https://github.com/brianium/paratest) with the command below:

```
./vendor/bin/paratest -f --colors -m 2 -p 4 tests

```

It took like half the time on local machine.

Docker
------

[](#docker)

Do not have PHP installed in your system? No problems. If you have [docker](https://www.docker.com/) installed run the following commands on project root to run Hookah:

- docker pull geshan/php-composer-alpine
- docker run -v $(pwd):/var/www geshan/php-composer-alpine "composer install --prefer-dist"
- docker run -v $(pwd):/var/www geshan/php-composer-alpine "./vendor/bin/phpunit --version"
- docker run -v $(pwd):/var/www geshan/php-composer-alpine "./vendor/bin/phpunit"

The first command will pull the container from docker hub registry, it is only`~40 MB` of data. The second command will install all the composer dependencies from the container.

The third command is optional, it will just print the phpunit version. The fourth command will run the tests from within the docker container.

Structure
---------

[](#structure)

The application is structured in a very simple way in `tests\Smoke` folder.

Smoke folder contains other 2 folders

- FrontEnd: to test response codes of front end user visible part of the website/web application without logging in.
- BackEnd: to test areas of the website/web application accessible after logging in.

The structure can be changed as this application now is a proof of concept to smoke test inspired by [this](http://bit.ly/1IUtepX) blog post (the code has been written differently following PSR-2 and newer libraries, still the essence is same).

Settings
--------

[](#settings)

You can set the base URL at `BaseTestCase.php` and users of the application at `BaseUserTestCase.php` constructor method. like

```
/**
 * @var string
 */
protected $baseUrl = 'http://drupal-test.jelastic.elastx.net/';

//other variables to override

/**
 * @var string
 */
protected $loginPath = 'user/login';

/**
 * @var string
 */
protected $usernameField = 'name';

/**
 * @var string
 */
protected $passwordField = 'pass';

/**
 * @var string
 */
protected $submitButtonText = 'Log in';

/**
 * @var array
 */
protected $users =  [
    ['role'=> 'admin', 'identifier' => 'admin', 'password' => '123admin'],
];

/**
 * @var string
 */
protected $loggedInLinkText = 'Log out';

/**
 * To be overridden by child class
 *
 * @var string
 */
protected  $userRole = 'none';

```

You can add your frontend paths in `providerFrontEnd` method in the PagesTest.Case extended from BaseTestCase.php file like below:

```
     return [
                [$this->baseUrl, 200],
                ['about', 200],
                ['not-existing', 404],
                ['.git', 403],
            ];

```

It uses php unit [data providers](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers.examples.DataTest.php)to take each of them to run the test case for front end tests.

The backend part is there too. The settings can be found in `AdminUserTest` extending `BaseUserTestCase` class, `providerBackEndPaths` method like below:

```
    $adminPaths = [
        ['admin', 200],
        ['admin/config', 200],
        ['not-existing', 404]
    ];

```

The tests are for now done for `http://drupal-test.jelastic.elastx.net/` for proof of concept, it is advised to hit the staging servers for smoke test than live servers depending on the need.

Coding Conventions
------------------

[](#coding-conventions)

We follow PSR-2 even to write tests.

Integration with travis
-----------------------

[](#integration-with-travis)

It can be integrated with travis CI to run the test on each push check the `.travis.yml` file in root of this project. It can be integrated in the same way with other CI systems too.

Contribute
----------

[](#contribute)

We would like to hear from you.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~43 days

Total

10

Last Release

3615d ago

Major Versions

0.6.1 → 1.6.252016-06-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/170554?v=4)[Geshan Manandhar](/maintainers/geshan)[@geshan](https://github.com/geshan)

---

Top Contributors

[![geshan](https://avatars.githubusercontent.com/u/170554?v=4)](https://github.com/geshan "geshan (45 commits)")

### Embed Badge

![Health badge](/badges/yipl-hookah/health.svg)

```
[![Health](https://phpackages.com/badges/yipl-hookah/health.svg)](https://phpackages.com/packages/yipl-hookah)
```

###  Alternatives

[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
