PHPackages                             brunty/kahlan-pdo - 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. brunty/kahlan-pdo

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

brunty/kahlan-pdo
=================

🗄 Provides functionality to work with PDO, reset a database and load fixtures within Kahlan

0.6(9y ago)137MITPHPPHP &gt;=7.0

Since Jul 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Brunty/kahlan-pdo)[ Packagist](https://packagist.org/packages/brunty/kahlan-pdo)[ RSS](/packages/brunty-kahlan-pdo/feed)WikiDiscussions master Synced 5mo ago

READMEChangelog (8)Dependencies (1)Versions (10)Used By (0)

Kahlan PDO
==========

[](#kahlan-pdo)

[![Build Status](https://camo.githubusercontent.com/ba84100c9461078a287d1d40cfc51f92d3adc42c67edeaba40039d51871ddefe/68747470733a2f2f7472617669732d63692e6f72672f4272756e74792f6b61686c616e2d70646f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Brunty/kahlan-pdo) [![SensioLabsInsight](https://camo.githubusercontent.com/fda79893bf345ad4fb3dc0c274ae1c1bf414ab80346c2cfcbb2b30c216886f30/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35623762323165322d383632372d346336622d393764332d3461373633303233613333632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/5b7b21e2-8627-4c6b-97d3-4a763023a33c)

🗄 Provides functionality to work with PDO, reset a database and load fixtures within Kahlan

Requirements
------------

[](#requirements)

- PHP &gt;= 7.0
- Kahlan ^3.0

Installation
------------

[](#installation)

`composer require brunty/kahlan-pdo --dev`

Setup
-----

[](#setup)

**Folders:**

1. Create a folder to store your database related files (`/spec/db` is suggested)
2. Create a folder to store your SQL files to load into the database (`/spec/db/sql` is suggested)
3. Within the folder where your database related files will be stored created a file `reset.php` which will be the file you'll use to reset your DB whenever you call the function to do so.
4. Within the folder where your database related files will be stored, created a `fixtures` folder
5. Create fixtures as you need for your tests in the `fixtures` folder.

**Config:**

In `kahlan-config.php` setup the path to your db folder and if you wish to use the `\Brunty\Kahlan\PDO\sql()` helper function, add the path to a directory that will hold SQL files as follows:

```
\Kahlan\box('db.path', __DIR__ . '/spec/db');
\Kahlan\box('db.path.sql', __DIR__ . '/spec/db/sql');
```

Usage
-----

[](#usage)

```
