├── .gitignore ├── LICENSE ├── README.md ├── behat.yml ├── composer.json ├── composer.lock ├── features ├── blog.feature ├── bootstrap │ └── FeatureContext.php ├── login.feature ├── plugins.feature └── post-manager.feature └── src ├── Context ├── Initializer │ └── WordPressContextInitializer.php └── WordPressContext.php └── ServiceContainer └── WordPressExtension.php /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | vendor 3 | *.phar 4 | .idea -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Walter Dal Mut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WordPress Extension for Behat 3 2 | =============================== 3 | 4 | This is a Behat 3.0 Extension for WordPress plugin and theme development. 5 | You can use it to test your WordPress installation, or just test your plugin/theme without installing them in a normal WordPress installation (i.e. stand-alone). 6 | The Extension allows you to use WordPress functions in your context class (if you extend it from Tmf\WordPressExtension\Context\WordPressContext). 7 | 8 | Installation 9 | ------------ 10 | 11 | 1. Add a composer development requirement for your WordPress theme or plugin: 12 | ```json 13 | { 14 | "require-dev" : { 15 | "tmf/wordpress-extension": "~0.1", 16 | "johnpbloch/wordpress": "~4.0.0" 17 | } 18 | } 19 | ``` 20 | 21 | 2. Add the following Behat configuration file: 22 | ```yml 23 | default: 24 | suites: 25 | default: 26 | contexts: 27 | - Tmf\WordPressExtension\Context\WordPressContext 28 | extensions: 29 | Tmf\WordPressExtension: 30 | path: '%paths.base/vendor/wordpress' 31 | 32 | Behat\MinkExtension: 33 | base_url: 'http://localhost:8000' 34 | sessions: 35 | default: 36 | goutte: ~ 37 | 38 | ``` 39 | 40 | 3. Install the vendors and initialize behat test suites 41 | ```bash 42 | composer update 43 | vendor/bin/behat --init 44 | ``` 45 | 4. Start your development web server and point its document root to the wordpress directory in vendors (without mail function) 46 | ```bash 47 | php -S localhost:8000 -t vendor/wordpress -d disable_functions=mail 48 | ``` 49 | 50 | 5. Write some Behat features and test them 51 | ``` 52 | Feature: Manage plugins 53 | In order to manage plugins 54 | As an admin 55 | I need to enable and disable plugins 56 | 57 | Background: 58 | Given I have a vanilla wordpress installation 59 | | name | email | username | password | 60 | | BDD WordPress | your@email.com | admin | test | 61 | And I am logged in as "admin" with password "test" 62 | 63 | Scenario: Enable the dolly plugin 64 | Given there are plugins 65 | | plugin | status | 66 | | hello.php | enabled | 67 | When I go to "/wp-admin/" 68 | Then I should see a "#dolly" element 69 | 70 | Scenario: Disable the dolly plugin 71 | Given there are plugins 72 | | plugin | status | 73 | | hello.php | disabled | 74 | When I go to "/wp-admin/" 75 | Then I should not see a "#dolly" element 76 | 77 | ``` 78 | 79 | 6. Run the tests 80 | ```bash 81 | vendor/bin/behat 82 | ``` 83 | 84 | -------------------------------------------------------------------------------- /behat.yml: -------------------------------------------------------------------------------- 1 | default: 2 | autoload: 3 | - %paths.base%/Features/Context 4 | suites: 5 | default: 6 | contexts: 7 | - Tmf\WordPressExtension\Context\WordPressContext 8 | extensions: 9 | Tmf\WordPressExtension: 10 | path: '%paths.base/vendor/wordpress' 11 | 12 | Behat\MinkExtension: 13 | base_url: 'http://localhost:8000' 14 | sessions: 15 | default: 16 | goutte: ~ 17 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tmf/wordpress-extension", 3 | "type": "library", 4 | "description": "WordPress extension for Behat 3", 5 | "authors": [ 6 | { 7 | "name": "wdalmut", 8 | "homepage": "https://github.com/wdalmut" 9 | }, 10 | { 11 | "name": "tmf", 12 | "email": "tom.forrer@gmail.com" 13 | } 14 | ], 15 | "keywords": [ 16 | "behat", 17 | "wordpress", 18 | "story", 19 | "bdd" 20 | ], 21 | "license": "MIT", 22 | "require": { 23 | "behat/behat": "~3.0,>=3.0.4", 24 | "behat/mink-extension": "~2.0@dev", 25 | "symfony/filesystem": "~2.3", 26 | "symfony/finder": "~2.3", 27 | "phpunit/phpunit": "~4.0" 28 | }, 29 | "require-dev": {}, 30 | "autoload": { 31 | "psr-4": { 32 | "Tmf\\WordPressExtension\\": "src" 33 | }, 34 | "files": [ "../../phpunit/phpunit/src/Framework/Assert/Functions.php" ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "95f91d94ff04fdfb0be8b71357694467", 8 | "packages": [ 9 | { 10 | "name": "behat/behat", 11 | "version": "v3.0.14", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/Behat/Behat.git", 15 | "reference": "3f097cd577feed73e681fa56cd4e4e1dda9c115d" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/Behat/Behat/zipball/3f097cd577feed73e681fa56cd4e4e1dda9c115d", 20 | "reference": "3f097cd577feed73e681fa56cd4e4e1dda9c115d", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "behat/gherkin": "~4.3", 25 | "behat/transliterator": "~1.0", 26 | "ext-mbstring": "*", 27 | "php": ">=5.3.3", 28 | "symfony/class-loader": "~2.1", 29 | "symfony/config": "~2.3", 30 | "symfony/console": "~2.1", 31 | "symfony/dependency-injection": "~2.1", 32 | "symfony/event-dispatcher": "~2.1", 33 | "symfony/translation": "~2.1", 34 | "symfony/yaml": "~2.1" 35 | }, 36 | "require-dev": { 37 | "phpspec/prophecy-phpunit": "~1.0", 38 | "phpunit/phpunit": "~4.0.7", 39 | "symfony/process": "~2.1" 40 | }, 41 | "suggest": { 42 | "behat/mink-extension": "for integration with Mink testing framework", 43 | "behat/symfony2-extension": "for integration with Symfony2 web framework", 44 | "behat/yii-extension": "for integration with Yii web framework" 45 | }, 46 | "bin": [ 47 | "bin/behat" 48 | ], 49 | "type": "library", 50 | "extra": { 51 | "branch-alias": { 52 | "dev-master": "3.0.x-dev" 53 | } 54 | }, 55 | "autoload": { 56 | "psr-0": { 57 | "Behat\\Behat": "src/", 58 | "Behat\\Testwork": "src/" 59 | } 60 | }, 61 | "notification-url": "https://packagist.org/downloads/", 62 | "license": [ 63 | "MIT" 64 | ], 65 | "authors": [ 66 | { 67 | "name": "Konstantin Kudryashov", 68 | "email": "ever.zet@gmail.com", 69 | "homepage": "http://everzet.com" 70 | } 71 | ], 72 | "description": "Scenario-oriented BDD framework for PHP 5.3", 73 | "homepage": "http://behat.org/", 74 | "keywords": [ 75 | "Agile", 76 | "BDD", 77 | "ScenarioBDD", 78 | "Scrum", 79 | "StoryBDD", 80 | "User story", 81 | "business", 82 | "development", 83 | "documentation", 84 | "examples", 85 | "symfony", 86 | "testing" 87 | ], 88 | "time": "2014-09-23 10:47:14" 89 | }, 90 | { 91 | "name": "behat/gherkin", 92 | "version": "v4.3.0", 93 | "source": { 94 | "type": "git", 95 | "url": "https://github.com/Behat/Gherkin.git", 96 | "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db" 97 | }, 98 | "dist": { 99 | "type": "zip", 100 | "url": "https://api.github.com/repos/Behat/Gherkin/zipball/43777c51058b77bcd84a8775b7a6ad05e986b5db", 101 | "reference": "43777c51058b77bcd84a8775b7a6ad05e986b5db", 102 | "shasum": "" 103 | }, 104 | "require": { 105 | "php": ">=5.3.1" 106 | }, 107 | "require-dev": { 108 | "phpunit/phpunit": "~4.0", 109 | "symfony/yaml": "~2.1" 110 | }, 111 | "suggest": { 112 | "symfony/yaml": "If you want to parse features, represented in YAML files" 113 | }, 114 | "type": "library", 115 | "extra": { 116 | "branch-alias": { 117 | "dev-master": "4.2-dev" 118 | } 119 | }, 120 | "autoload": { 121 | "psr-0": { 122 | "Behat\\Gherkin": "src/" 123 | } 124 | }, 125 | "notification-url": "https://packagist.org/downloads/", 126 | "license": [ 127 | "MIT" 128 | ], 129 | "authors": [ 130 | { 131 | "name": "Konstantin Kudryashov", 132 | "email": "ever.zet@gmail.com", 133 | "homepage": "http://everzet.com" 134 | } 135 | ], 136 | "description": "Gherkin DSL parser for PHP 5.3", 137 | "homepage": "http://behat.org/", 138 | "keywords": [ 139 | "BDD", 140 | "Behat", 141 | "Cucumber", 142 | "DSL", 143 | "gherkin", 144 | "parser" 145 | ], 146 | "time": "2014-06-06 01:24:32" 147 | }, 148 | { 149 | "name": "behat/mink", 150 | "version": "v1.6.0", 151 | "source": { 152 | "type": "git", 153 | "url": "https://github.com/Behat/Mink.git", 154 | "reference": "090900a0049c441f1e072bbd837db4079b2250c5" 155 | }, 156 | "dist": { 157 | "type": "zip", 158 | "url": "https://api.github.com/repos/Behat/Mink/zipball/090900a0049c441f1e072bbd837db4079b2250c5", 159 | "reference": "090900a0049c441f1e072bbd837db4079b2250c5", 160 | "shasum": "" 161 | }, 162 | "require": { 163 | "php": ">=5.3.1", 164 | "symfony/css-selector": "~2.0" 165 | }, 166 | "suggest": { 167 | "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", 168 | "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", 169 | "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", 170 | "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" 171 | }, 172 | "type": "library", 173 | "extra": { 174 | "branch-alias": { 175 | "dev-master": "1.6.x-dev" 176 | } 177 | }, 178 | "autoload": { 179 | "psr-0": { 180 | "Behat\\Mink": "src/" 181 | } 182 | }, 183 | "notification-url": "https://packagist.org/downloads/", 184 | "license": [ 185 | "MIT" 186 | ], 187 | "authors": [ 188 | { 189 | "name": "Konstantin Kudryashov", 190 | "email": "ever.zet@gmail.com", 191 | "homepage": "http://everzet.com" 192 | } 193 | ], 194 | "description": "Web acceptance testing framework for PHP 5.3", 195 | "homepage": "http://mink.behat.org/", 196 | "keywords": [ 197 | "browser", 198 | "testing", 199 | "web" 200 | ], 201 | "time": "2014-09-26 09:25:05" 202 | }, 203 | { 204 | "name": "behat/mink-extension", 205 | "version": "dev-master", 206 | "source": { 207 | "type": "git", 208 | "url": "https://github.com/Behat/MinkExtension.git", 209 | "reference": "2ab8c00c59995824c6ebcd50617f8c3a4d78d2d9" 210 | }, 211 | "dist": { 212 | "type": "zip", 213 | "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/2ab8c00c59995824c6ebcd50617f8c3a4d78d2d9", 214 | "reference": "2ab8c00c59995824c6ebcd50617f8c3a4d78d2d9", 215 | "shasum": "" 216 | }, 217 | "require": { 218 | "behat/behat": "~3.0,>=3.0.5", 219 | "behat/mink": "~1.5", 220 | "php": ">=5.3.2", 221 | "symfony/config": "~2.2" 222 | }, 223 | "require-dev": { 224 | "behat/mink-goutte-driver": "~1.1@dev", 225 | "phpspec/phpspec": "~2.0" 226 | }, 227 | "type": "behat-extension", 228 | "extra": { 229 | "branch-alias": { 230 | "dev-master": "2.0.x-dev" 231 | } 232 | }, 233 | "autoload": { 234 | "psr-0": { 235 | "Behat\\MinkExtension": "src/" 236 | } 237 | }, 238 | "notification-url": "https://packagist.org/downloads/", 239 | "license": [ 240 | "MIT" 241 | ], 242 | "authors": [ 243 | { 244 | "name": "Christophe Coevoet", 245 | "email": "stof@notk.org" 246 | }, 247 | { 248 | "name": "Konstantin Kudryashov", 249 | "email": "ever.zet@gmail.com" 250 | } 251 | ], 252 | "description": "Mink extension for Behat", 253 | "homepage": "http://extensions.behat.org/mink", 254 | "keywords": [ 255 | "browser", 256 | "gui", 257 | "test", 258 | "web" 259 | ], 260 | "time": "2014-10-08 08:13:38" 261 | }, 262 | { 263 | "name": "behat/transliterator", 264 | "version": "v1.0.1", 265 | "source": { 266 | "type": "git", 267 | "url": "https://github.com/Behat/Transliterator.git", 268 | "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4" 269 | }, 270 | "dist": { 271 | "type": "zip", 272 | "url": "https://api.github.com/repos/Behat/Transliterator/zipball/c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", 273 | "reference": "c93521d3462a554332d1ef5bb0e9b5b8ca4106c4", 274 | "shasum": "" 275 | }, 276 | "require": { 277 | "php": ">=5.3.3" 278 | }, 279 | "type": "library", 280 | "extra": { 281 | "branch-alias": { 282 | "dev-master": "1.0-dev" 283 | } 284 | }, 285 | "autoload": { 286 | "psr-0": { 287 | "Behat\\Transliterator": "src/" 288 | } 289 | }, 290 | "notification-url": "https://packagist.org/downloads/", 291 | "license": [ 292 | "Artistic-1.0" 293 | ], 294 | "description": "String transliterator", 295 | "keywords": [ 296 | "i18n", 297 | "slug", 298 | "transliterator" 299 | ], 300 | "time": "2014-05-15 22:08:22" 301 | }, 302 | { 303 | "name": "doctrine/instantiator", 304 | "version": "1.0.4", 305 | "source": { 306 | "type": "git", 307 | "url": "https://github.com/doctrine/instantiator.git", 308 | "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" 309 | }, 310 | "dist": { 311 | "type": "zip", 312 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", 313 | "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", 314 | "shasum": "" 315 | }, 316 | "require": { 317 | "php": ">=5.3,<8.0-DEV" 318 | }, 319 | "require-dev": { 320 | "athletic/athletic": "~0.1.8", 321 | "ext-pdo": "*", 322 | "ext-phar": "*", 323 | "phpunit/phpunit": "~4.0", 324 | "squizlabs/php_codesniffer": "2.0.*@ALPHA" 325 | }, 326 | "type": "library", 327 | "extra": { 328 | "branch-alias": { 329 | "dev-master": "1.0.x-dev" 330 | } 331 | }, 332 | "autoload": { 333 | "psr-0": { 334 | "Doctrine\\Instantiator\\": "src" 335 | } 336 | }, 337 | "notification-url": "https://packagist.org/downloads/", 338 | "license": [ 339 | "MIT" 340 | ], 341 | "authors": [ 342 | { 343 | "name": "Marco Pivetta", 344 | "email": "ocramius@gmail.com", 345 | "homepage": "http://ocramius.github.com/" 346 | } 347 | ], 348 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 349 | "homepage": "https://github.com/doctrine/instantiator", 350 | "keywords": [ 351 | "constructor", 352 | "instantiate" 353 | ], 354 | "time": "2014-10-13 12:58:55" 355 | }, 356 | { 357 | "name": "phpunit/php-code-coverage", 358 | "version": "2.0.11", 359 | "source": { 360 | "type": "git", 361 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 362 | "reference": "53603b3c995f5aab6b59c8e08c3a663d2cc810b7" 363 | }, 364 | "dist": { 365 | "type": "zip", 366 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/53603b3c995f5aab6b59c8e08c3a663d2cc810b7", 367 | "reference": "53603b3c995f5aab6b59c8e08c3a663d2cc810b7", 368 | "shasum": "" 369 | }, 370 | "require": { 371 | "php": ">=5.3.3", 372 | "phpunit/php-file-iterator": "~1.3", 373 | "phpunit/php-text-template": "~1.2", 374 | "phpunit/php-token-stream": "~1.3", 375 | "sebastian/environment": "~1.0", 376 | "sebastian/version": "~1.0" 377 | }, 378 | "require-dev": { 379 | "ext-xdebug": ">=2.1.4", 380 | "phpunit/phpunit": "~4.1" 381 | }, 382 | "suggest": { 383 | "ext-dom": "*", 384 | "ext-xdebug": ">=2.2.1", 385 | "ext-xmlwriter": "*" 386 | }, 387 | "type": "library", 388 | "extra": { 389 | "branch-alias": { 390 | "dev-master": "2.0.x-dev" 391 | } 392 | }, 393 | "autoload": { 394 | "classmap": [ 395 | "src/" 396 | ] 397 | }, 398 | "notification-url": "https://packagist.org/downloads/", 399 | "include-path": [ 400 | "" 401 | ], 402 | "license": [ 403 | "BSD-3-Clause" 404 | ], 405 | "authors": [ 406 | { 407 | "name": "Sebastian Bergmann", 408 | "email": "sb@sebastian-bergmann.de", 409 | "role": "lead" 410 | } 411 | ], 412 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 413 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 414 | "keywords": [ 415 | "coverage", 416 | "testing", 417 | "xunit" 418 | ], 419 | "time": "2014-08-31 06:33:04" 420 | }, 421 | { 422 | "name": "phpunit/php-file-iterator", 423 | "version": "1.3.4", 424 | "source": { 425 | "type": "git", 426 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 427 | "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb" 428 | }, 429 | "dist": { 430 | "type": "zip", 431 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb", 432 | "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb", 433 | "shasum": "" 434 | }, 435 | "require": { 436 | "php": ">=5.3.3" 437 | }, 438 | "type": "library", 439 | "autoload": { 440 | "classmap": [ 441 | "File/" 442 | ] 443 | }, 444 | "notification-url": "https://packagist.org/downloads/", 445 | "include-path": [ 446 | "" 447 | ], 448 | "license": [ 449 | "BSD-3-Clause" 450 | ], 451 | "authors": [ 452 | { 453 | "name": "Sebastian Bergmann", 454 | "email": "sb@sebastian-bergmann.de", 455 | "role": "lead" 456 | } 457 | ], 458 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 459 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 460 | "keywords": [ 461 | "filesystem", 462 | "iterator" 463 | ], 464 | "time": "2013-10-10 15:34:57" 465 | }, 466 | { 467 | "name": "phpunit/php-text-template", 468 | "version": "1.2.0", 469 | "source": { 470 | "type": "git", 471 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 472 | "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" 473 | }, 474 | "dist": { 475 | "type": "zip", 476 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", 477 | "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", 478 | "shasum": "" 479 | }, 480 | "require": { 481 | "php": ">=5.3.3" 482 | }, 483 | "type": "library", 484 | "autoload": { 485 | "classmap": [ 486 | "Text/" 487 | ] 488 | }, 489 | "notification-url": "https://packagist.org/downloads/", 490 | "include-path": [ 491 | "" 492 | ], 493 | "license": [ 494 | "BSD-3-Clause" 495 | ], 496 | "authors": [ 497 | { 498 | "name": "Sebastian Bergmann", 499 | "email": "sb@sebastian-bergmann.de", 500 | "role": "lead" 501 | } 502 | ], 503 | "description": "Simple template engine.", 504 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 505 | "keywords": [ 506 | "template" 507 | ], 508 | "time": "2014-01-30 17:20:04" 509 | }, 510 | { 511 | "name": "phpunit/php-timer", 512 | "version": "1.0.5", 513 | "source": { 514 | "type": "git", 515 | "url": "https://github.com/sebastianbergmann/php-timer.git", 516 | "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" 517 | }, 518 | "dist": { 519 | "type": "zip", 520 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", 521 | "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", 522 | "shasum": "" 523 | }, 524 | "require": { 525 | "php": ">=5.3.3" 526 | }, 527 | "type": "library", 528 | "autoload": { 529 | "classmap": [ 530 | "PHP/" 531 | ] 532 | }, 533 | "notification-url": "https://packagist.org/downloads/", 534 | "include-path": [ 535 | "" 536 | ], 537 | "license": [ 538 | "BSD-3-Clause" 539 | ], 540 | "authors": [ 541 | { 542 | "name": "Sebastian Bergmann", 543 | "email": "sb@sebastian-bergmann.de", 544 | "role": "lead" 545 | } 546 | ], 547 | "description": "Utility class for timing", 548 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 549 | "keywords": [ 550 | "timer" 551 | ], 552 | "time": "2013-08-02 07:42:54" 553 | }, 554 | { 555 | "name": "phpunit/php-token-stream", 556 | "version": "1.3.0", 557 | "source": { 558 | "type": "git", 559 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 560 | "reference": "f8d5d08c56de5cfd592b3340424a81733259a876" 561 | }, 562 | "dist": { 563 | "type": "zip", 564 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/f8d5d08c56de5cfd592b3340424a81733259a876", 565 | "reference": "f8d5d08c56de5cfd592b3340424a81733259a876", 566 | "shasum": "" 567 | }, 568 | "require": { 569 | "ext-tokenizer": "*", 570 | "php": ">=5.3.3" 571 | }, 572 | "require-dev": { 573 | "phpunit/phpunit": "~4.2" 574 | }, 575 | "type": "library", 576 | "extra": { 577 | "branch-alias": { 578 | "dev-master": "1.3-dev" 579 | } 580 | }, 581 | "autoload": { 582 | "classmap": [ 583 | "src/" 584 | ] 585 | }, 586 | "notification-url": "https://packagist.org/downloads/", 587 | "license": [ 588 | "BSD-3-Clause" 589 | ], 590 | "authors": [ 591 | { 592 | "name": "Sebastian Bergmann", 593 | "email": "sebastian@phpunit.de" 594 | } 595 | ], 596 | "description": "Wrapper around PHP's tokenizer extension.", 597 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 598 | "keywords": [ 599 | "tokenizer" 600 | ], 601 | "time": "2014-08-31 06:12:13" 602 | }, 603 | { 604 | "name": "phpunit/phpunit", 605 | "version": "4.3.4", 606 | "source": { 607 | "type": "git", 608 | "url": "https://github.com/sebastianbergmann/phpunit.git", 609 | "reference": "23e4e0310f037aae873cc81b8658dbbb82878f71" 610 | }, 611 | "dist": { 612 | "type": "zip", 613 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/23e4e0310f037aae873cc81b8658dbbb82878f71", 614 | "reference": "23e4e0310f037aae873cc81b8658dbbb82878f71", 615 | "shasum": "" 616 | }, 617 | "require": { 618 | "ext-dom": "*", 619 | "ext-json": "*", 620 | "ext-pcre": "*", 621 | "ext-reflection": "*", 622 | "ext-spl": "*", 623 | "php": ">=5.3.3", 624 | "phpunit/php-code-coverage": "~2.0", 625 | "phpunit/php-file-iterator": "~1.3.2", 626 | "phpunit/php-text-template": "~1.2", 627 | "phpunit/php-timer": "~1.0.2", 628 | "phpunit/phpunit-mock-objects": "~2.3", 629 | "sebastian/comparator": "~1.0", 630 | "sebastian/diff": "~1.1", 631 | "sebastian/environment": "~1.0", 632 | "sebastian/exporter": "~1.0", 633 | "sebastian/version": "~1.0", 634 | "symfony/yaml": "~2.0" 635 | }, 636 | "suggest": { 637 | "phpunit/php-invoker": "~1.1" 638 | }, 639 | "bin": [ 640 | "phpunit" 641 | ], 642 | "type": "library", 643 | "extra": { 644 | "branch-alias": { 645 | "dev-master": "4.3.x-dev" 646 | } 647 | }, 648 | "autoload": { 649 | "classmap": [ 650 | "src/" 651 | ] 652 | }, 653 | "notification-url": "https://packagist.org/downloads/", 654 | "include-path": [ 655 | "", 656 | "../../symfony/yaml/" 657 | ], 658 | "license": [ 659 | "BSD-3-Clause" 660 | ], 661 | "authors": [ 662 | { 663 | "name": "Sebastian Bergmann", 664 | "email": "sebastian@phpunit.de", 665 | "role": "lead" 666 | } 667 | ], 668 | "description": "The PHP Unit Testing framework.", 669 | "homepage": "http://www.phpunit.de/", 670 | "keywords": [ 671 | "phpunit", 672 | "testing", 673 | "xunit" 674 | ], 675 | "time": "2014-10-22 11:43:12" 676 | }, 677 | { 678 | "name": "phpunit/phpunit-mock-objects", 679 | "version": "2.3.0", 680 | "source": { 681 | "type": "git", 682 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 683 | "reference": "c63d2367247365f688544f0d500af90a11a44c65" 684 | }, 685 | "dist": { 686 | "type": "zip", 687 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/c63d2367247365f688544f0d500af90a11a44c65", 688 | "reference": "c63d2367247365f688544f0d500af90a11a44c65", 689 | "shasum": "" 690 | }, 691 | "require": { 692 | "doctrine/instantiator": "~1.0,>=1.0.1", 693 | "php": ">=5.3.3", 694 | "phpunit/php-text-template": "~1.2" 695 | }, 696 | "require-dev": { 697 | "phpunit/phpunit": "~4.3" 698 | }, 699 | "suggest": { 700 | "ext-soap": "*" 701 | }, 702 | "type": "library", 703 | "extra": { 704 | "branch-alias": { 705 | "dev-master": "2.3.x-dev" 706 | } 707 | }, 708 | "autoload": { 709 | "classmap": [ 710 | "src/" 711 | ] 712 | }, 713 | "notification-url": "https://packagist.org/downloads/", 714 | "license": [ 715 | "BSD-3-Clause" 716 | ], 717 | "authors": [ 718 | { 719 | "name": "Sebastian Bergmann", 720 | "email": "sb@sebastian-bergmann.de", 721 | "role": "lead" 722 | } 723 | ], 724 | "description": "Mock Object library for PHPUnit", 725 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 726 | "keywords": [ 727 | "mock", 728 | "xunit" 729 | ], 730 | "time": "2014-10-03 05:12:11" 731 | }, 732 | { 733 | "name": "sebastian/comparator", 734 | "version": "1.0.1", 735 | "source": { 736 | "type": "git", 737 | "url": "https://github.com/sebastianbergmann/comparator.git", 738 | "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef" 739 | }, 740 | "dist": { 741 | "type": "zip", 742 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", 743 | "reference": "e54a01c0da1b87db3c5a3c4c5277ddf331da4aef", 744 | "shasum": "" 745 | }, 746 | "require": { 747 | "php": ">=5.3.3", 748 | "sebastian/diff": "~1.1", 749 | "sebastian/exporter": "~1.0" 750 | }, 751 | "require-dev": { 752 | "phpunit/phpunit": "~4.1" 753 | }, 754 | "type": "library", 755 | "extra": { 756 | "branch-alias": { 757 | "dev-master": "1.0.x-dev" 758 | } 759 | }, 760 | "autoload": { 761 | "classmap": [ 762 | "src/" 763 | ] 764 | }, 765 | "notification-url": "https://packagist.org/downloads/", 766 | "license": [ 767 | "BSD-3-Clause" 768 | ], 769 | "authors": [ 770 | { 771 | "name": "Jeff Welch", 772 | "email": "whatthejeff@gmail.com" 773 | }, 774 | { 775 | "name": "Volker Dusch", 776 | "email": "github@wallbash.com" 777 | }, 778 | { 779 | "name": "Bernhard Schussek", 780 | "email": "bschussek@2bepublished.at" 781 | }, 782 | { 783 | "name": "Sebastian Bergmann", 784 | "email": "sebastian@phpunit.de" 785 | } 786 | ], 787 | "description": "Provides the functionality to compare PHP values for equality", 788 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 789 | "keywords": [ 790 | "comparator", 791 | "compare", 792 | "equality" 793 | ], 794 | "time": "2014-05-11 23:00:21" 795 | }, 796 | { 797 | "name": "sebastian/diff", 798 | "version": "1.2.0", 799 | "source": { 800 | "type": "git", 801 | "url": "https://github.com/sebastianbergmann/diff.git", 802 | "reference": "5843509fed39dee4b356a306401e9dd1a931fec7" 803 | }, 804 | "dist": { 805 | "type": "zip", 806 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/5843509fed39dee4b356a306401e9dd1a931fec7", 807 | "reference": "5843509fed39dee4b356a306401e9dd1a931fec7", 808 | "shasum": "" 809 | }, 810 | "require": { 811 | "php": ">=5.3.3" 812 | }, 813 | "require-dev": { 814 | "phpunit/phpunit": "~4.2" 815 | }, 816 | "type": "library", 817 | "extra": { 818 | "branch-alias": { 819 | "dev-master": "1.2-dev" 820 | } 821 | }, 822 | "autoload": { 823 | "classmap": [ 824 | "src/" 825 | ] 826 | }, 827 | "notification-url": "https://packagist.org/downloads/", 828 | "license": [ 829 | "BSD-3-Clause" 830 | ], 831 | "authors": [ 832 | { 833 | "name": "Kore Nordmann", 834 | "email": "mail@kore-nordmann.de" 835 | }, 836 | { 837 | "name": "Sebastian Bergmann", 838 | "email": "sebastian@phpunit.de" 839 | } 840 | ], 841 | "description": "Diff implementation", 842 | "homepage": "http://www.github.com/sebastianbergmann/diff", 843 | "keywords": [ 844 | "diff" 845 | ], 846 | "time": "2014-08-15 10:29:00" 847 | }, 848 | { 849 | "name": "sebastian/environment", 850 | "version": "1.2.0", 851 | "source": { 852 | "type": "git", 853 | "url": "https://github.com/sebastianbergmann/environment.git", 854 | "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d" 855 | }, 856 | "dist": { 857 | "type": "zip", 858 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0d9bf79554d2a999da194a60416c15cf461eb67d", 859 | "reference": "0d9bf79554d2a999da194a60416c15cf461eb67d", 860 | "shasum": "" 861 | }, 862 | "require": { 863 | "php": ">=5.3.3" 864 | }, 865 | "require-dev": { 866 | "phpunit/phpunit": "~4.3" 867 | }, 868 | "type": "library", 869 | "extra": { 870 | "branch-alias": { 871 | "dev-master": "1.2.x-dev" 872 | } 873 | }, 874 | "autoload": { 875 | "classmap": [ 876 | "src/" 877 | ] 878 | }, 879 | "notification-url": "https://packagist.org/downloads/", 880 | "license": [ 881 | "BSD-3-Clause" 882 | ], 883 | "authors": [ 884 | { 885 | "name": "Sebastian Bergmann", 886 | "email": "sebastian@phpunit.de" 887 | } 888 | ], 889 | "description": "Provides functionality to handle HHVM/PHP environments", 890 | "homepage": "http://www.github.com/sebastianbergmann/environment", 891 | "keywords": [ 892 | "Xdebug", 893 | "environment", 894 | "hhvm" 895 | ], 896 | "time": "2014-10-22 06:38:05" 897 | }, 898 | { 899 | "name": "sebastian/exporter", 900 | "version": "1.0.2", 901 | "source": { 902 | "type": "git", 903 | "url": "https://github.com/sebastianbergmann/exporter.git", 904 | "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0" 905 | }, 906 | "dist": { 907 | "type": "zip", 908 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", 909 | "reference": "c7d59948d6e82818e1bdff7cadb6c34710eb7dc0", 910 | "shasum": "" 911 | }, 912 | "require": { 913 | "php": ">=5.3.3" 914 | }, 915 | "require-dev": { 916 | "phpunit/phpunit": "~4.0" 917 | }, 918 | "type": "library", 919 | "extra": { 920 | "branch-alias": { 921 | "dev-master": "1.0.x-dev" 922 | } 923 | }, 924 | "autoload": { 925 | "classmap": [ 926 | "src/" 927 | ] 928 | }, 929 | "notification-url": "https://packagist.org/downloads/", 930 | "license": [ 931 | "BSD-3-Clause" 932 | ], 933 | "authors": [ 934 | { 935 | "name": "Jeff Welch", 936 | "email": "whatthejeff@gmail.com" 937 | }, 938 | { 939 | "name": "Volker Dusch", 940 | "email": "github@wallbash.com" 941 | }, 942 | { 943 | "name": "Bernhard Schussek", 944 | "email": "bschussek@2bepublished.at" 945 | }, 946 | { 947 | "name": "Sebastian Bergmann", 948 | "email": "sebastian@phpunit.de" 949 | }, 950 | { 951 | "name": "Adam Harvey", 952 | "email": "aharvey@php.net" 953 | } 954 | ], 955 | "description": "Provides the functionality to export PHP variables for visualization", 956 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 957 | "keywords": [ 958 | "export", 959 | "exporter" 960 | ], 961 | "time": "2014-09-10 00:51:36" 962 | }, 963 | { 964 | "name": "sebastian/version", 965 | "version": "1.0.3", 966 | "source": { 967 | "type": "git", 968 | "url": "https://github.com/sebastianbergmann/version.git", 969 | "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" 970 | }, 971 | "dist": { 972 | "type": "zip", 973 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", 974 | "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", 975 | "shasum": "" 976 | }, 977 | "type": "library", 978 | "autoload": { 979 | "classmap": [ 980 | "src/" 981 | ] 982 | }, 983 | "notification-url": "https://packagist.org/downloads/", 984 | "license": [ 985 | "BSD-3-Clause" 986 | ], 987 | "authors": [ 988 | { 989 | "name": "Sebastian Bergmann", 990 | "email": "sebastian@phpunit.de", 991 | "role": "lead" 992 | } 993 | ], 994 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 995 | "homepage": "https://github.com/sebastianbergmann/version", 996 | "time": "2014-03-07 15:35:33" 997 | }, 998 | { 999 | "name": "symfony/class-loader", 1000 | "version": "v2.5.6", 1001 | "target-dir": "Symfony/Component/ClassLoader", 1002 | "source": { 1003 | "type": "git", 1004 | "url": "https://github.com/symfony/ClassLoader.git", 1005 | "reference": "174f30f12a2e9235d79399699bd0dce4f044a9ab" 1006 | }, 1007 | "dist": { 1008 | "type": "zip", 1009 | "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/174f30f12a2e9235d79399699bd0dce4f044a9ab", 1010 | "reference": "174f30f12a2e9235d79399699bd0dce4f044a9ab", 1011 | "shasum": "" 1012 | }, 1013 | "require": { 1014 | "php": ">=5.3.3" 1015 | }, 1016 | "require-dev": { 1017 | "symfony/finder": "~2.0" 1018 | }, 1019 | "type": "library", 1020 | "extra": { 1021 | "branch-alias": { 1022 | "dev-master": "2.5-dev" 1023 | } 1024 | }, 1025 | "autoload": { 1026 | "psr-0": { 1027 | "Symfony\\Component\\ClassLoader\\": "" 1028 | } 1029 | }, 1030 | "notification-url": "https://packagist.org/downloads/", 1031 | "license": [ 1032 | "MIT" 1033 | ], 1034 | "authors": [ 1035 | { 1036 | "name": "Symfony Community", 1037 | "homepage": "http://symfony.com/contributors" 1038 | }, 1039 | { 1040 | "name": "Fabien Potencier", 1041 | "email": "fabien@symfony.com" 1042 | } 1043 | ], 1044 | "description": "Symfony ClassLoader Component", 1045 | "homepage": "http://symfony.com", 1046 | "time": "2014-10-01 05:50:18" 1047 | }, 1048 | { 1049 | "name": "symfony/config", 1050 | "version": "v2.5.6", 1051 | "target-dir": "Symfony/Component/Config", 1052 | "source": { 1053 | "type": "git", 1054 | "url": "https://github.com/symfony/Config.git", 1055 | "reference": "0316364bfebc8b080077c731a99f189341476bd7" 1056 | }, 1057 | "dist": { 1058 | "type": "zip", 1059 | "url": "https://api.github.com/repos/symfony/Config/zipball/0316364bfebc8b080077c731a99f189341476bd7", 1060 | "reference": "0316364bfebc8b080077c731a99f189341476bd7", 1061 | "shasum": "" 1062 | }, 1063 | "require": { 1064 | "php": ">=5.3.3", 1065 | "symfony/filesystem": "~2.3" 1066 | }, 1067 | "type": "library", 1068 | "extra": { 1069 | "branch-alias": { 1070 | "dev-master": "2.5-dev" 1071 | } 1072 | }, 1073 | "autoload": { 1074 | "psr-0": { 1075 | "Symfony\\Component\\Config\\": "" 1076 | } 1077 | }, 1078 | "notification-url": "https://packagist.org/downloads/", 1079 | "license": [ 1080 | "MIT" 1081 | ], 1082 | "authors": [ 1083 | { 1084 | "name": "Symfony Community", 1085 | "homepage": "http://symfony.com/contributors" 1086 | }, 1087 | { 1088 | "name": "Fabien Potencier", 1089 | "email": "fabien@symfony.com" 1090 | } 1091 | ], 1092 | "description": "Symfony Config Component", 1093 | "homepage": "http://symfony.com", 1094 | "time": "2014-09-23 05:25:11" 1095 | }, 1096 | { 1097 | "name": "symfony/console", 1098 | "version": "v2.5.6", 1099 | "target-dir": "Symfony/Component/Console", 1100 | "source": { 1101 | "type": "git", 1102 | "url": "https://github.com/symfony/Console.git", 1103 | "reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0" 1104 | }, 1105 | "dist": { 1106 | "type": "zip", 1107 | "url": "https://api.github.com/repos/symfony/Console/zipball/6f177fca24200a5b97aef5ce7a5c98124a0f0db0", 1108 | "reference": "6f177fca24200a5b97aef5ce7a5c98124a0f0db0", 1109 | "shasum": "" 1110 | }, 1111 | "require": { 1112 | "php": ">=5.3.3" 1113 | }, 1114 | "require-dev": { 1115 | "psr/log": "~1.0", 1116 | "symfony/event-dispatcher": "~2.1" 1117 | }, 1118 | "suggest": { 1119 | "psr/log": "For using the console logger", 1120 | "symfony/event-dispatcher": "" 1121 | }, 1122 | "type": "library", 1123 | "extra": { 1124 | "branch-alias": { 1125 | "dev-master": "2.5-dev" 1126 | } 1127 | }, 1128 | "autoload": { 1129 | "psr-0": { 1130 | "Symfony\\Component\\Console\\": "" 1131 | } 1132 | }, 1133 | "notification-url": "https://packagist.org/downloads/", 1134 | "license": [ 1135 | "MIT" 1136 | ], 1137 | "authors": [ 1138 | { 1139 | "name": "Symfony Community", 1140 | "homepage": "http://symfony.com/contributors" 1141 | }, 1142 | { 1143 | "name": "Fabien Potencier", 1144 | "email": "fabien@symfony.com" 1145 | } 1146 | ], 1147 | "description": "Symfony Console Component", 1148 | "homepage": "http://symfony.com", 1149 | "time": "2014-10-05 13:57:04" 1150 | }, 1151 | { 1152 | "name": "symfony/css-selector", 1153 | "version": "v2.5.6", 1154 | "target-dir": "Symfony/Component/CssSelector", 1155 | "source": { 1156 | "type": "git", 1157 | "url": "https://github.com/symfony/CssSelector.git", 1158 | "reference": "7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc" 1159 | }, 1160 | "dist": { 1161 | "type": "zip", 1162 | "url": "https://api.github.com/repos/symfony/CssSelector/zipball/7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc", 1163 | "reference": "7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc", 1164 | "shasum": "" 1165 | }, 1166 | "require": { 1167 | "php": ">=5.3.3" 1168 | }, 1169 | "type": "library", 1170 | "extra": { 1171 | "branch-alias": { 1172 | "dev-master": "2.5-dev" 1173 | } 1174 | }, 1175 | "autoload": { 1176 | "psr-0": { 1177 | "Symfony\\Component\\CssSelector\\": "" 1178 | } 1179 | }, 1180 | "notification-url": "https://packagist.org/downloads/", 1181 | "license": [ 1182 | "MIT" 1183 | ], 1184 | "authors": [ 1185 | { 1186 | "name": "Symfony Community", 1187 | "homepage": "http://symfony.com/contributors" 1188 | }, 1189 | { 1190 | "name": "Jean-François Simon", 1191 | "email": "jeanfrancois.simon@sensiolabs.com" 1192 | }, 1193 | { 1194 | "name": "Fabien Potencier", 1195 | "email": "fabien@symfony.com" 1196 | } 1197 | ], 1198 | "description": "Symfony CssSelector Component", 1199 | "homepage": "http://symfony.com", 1200 | "time": "2014-10-09 16:00:03" 1201 | }, 1202 | { 1203 | "name": "symfony/dependency-injection", 1204 | "version": "v2.5.6", 1205 | "target-dir": "Symfony/Component/DependencyInjection", 1206 | "source": { 1207 | "type": "git", 1208 | "url": "https://github.com/symfony/DependencyInjection.git", 1209 | "reference": "fb40e4ea115d331346fbbc4da8f42825e524c7a0" 1210 | }, 1211 | "dist": { 1212 | "type": "zip", 1213 | "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/fb40e4ea115d331346fbbc4da8f42825e524c7a0", 1214 | "reference": "fb40e4ea115d331346fbbc4da8f42825e524c7a0", 1215 | "shasum": "" 1216 | }, 1217 | "require": { 1218 | "php": ">=5.3.3" 1219 | }, 1220 | "require-dev": { 1221 | "symfony/config": "~2.2", 1222 | "symfony/expression-language": "~2.4", 1223 | "symfony/yaml": "~2.0" 1224 | }, 1225 | "suggest": { 1226 | "symfony/config": "", 1227 | "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", 1228 | "symfony/yaml": "" 1229 | }, 1230 | "type": "library", 1231 | "extra": { 1232 | "branch-alias": { 1233 | "dev-master": "2.5-dev" 1234 | } 1235 | }, 1236 | "autoload": { 1237 | "psr-0": { 1238 | "Symfony\\Component\\DependencyInjection\\": "" 1239 | } 1240 | }, 1241 | "notification-url": "https://packagist.org/downloads/", 1242 | "license": [ 1243 | "MIT" 1244 | ], 1245 | "authors": [ 1246 | { 1247 | "name": "Symfony Community", 1248 | "homepage": "http://symfony.com/contributors" 1249 | }, 1250 | { 1251 | "name": "Fabien Potencier", 1252 | "email": "fabien@symfony.com" 1253 | } 1254 | ], 1255 | "description": "Symfony DependencyInjection Component", 1256 | "homepage": "http://symfony.com", 1257 | "time": "2014-10-01 05:50:18" 1258 | }, 1259 | { 1260 | "name": "symfony/event-dispatcher", 1261 | "version": "v2.5.6", 1262 | "target-dir": "Symfony/Component/EventDispatcher", 1263 | "source": { 1264 | "type": "git", 1265 | "url": "https://github.com/symfony/EventDispatcher.git", 1266 | "reference": "804eb28dbbfba9ffdab21fe2066744906cea2212" 1267 | }, 1268 | "dist": { 1269 | "type": "zip", 1270 | "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/804eb28dbbfba9ffdab21fe2066744906cea2212", 1271 | "reference": "804eb28dbbfba9ffdab21fe2066744906cea2212", 1272 | "shasum": "" 1273 | }, 1274 | "require": { 1275 | "php": ">=5.3.3" 1276 | }, 1277 | "require-dev": { 1278 | "psr/log": "~1.0", 1279 | "symfony/config": "~2.0", 1280 | "symfony/dependency-injection": "~2.0,<2.6.0", 1281 | "symfony/stopwatch": "~2.2" 1282 | }, 1283 | "suggest": { 1284 | "symfony/dependency-injection": "", 1285 | "symfony/http-kernel": "" 1286 | }, 1287 | "type": "library", 1288 | "extra": { 1289 | "branch-alias": { 1290 | "dev-master": "2.5-dev" 1291 | } 1292 | }, 1293 | "autoload": { 1294 | "psr-0": { 1295 | "Symfony\\Component\\EventDispatcher\\": "" 1296 | } 1297 | }, 1298 | "notification-url": "https://packagist.org/downloads/", 1299 | "license": [ 1300 | "MIT" 1301 | ], 1302 | "authors": [ 1303 | { 1304 | "name": "Symfony Community", 1305 | "homepage": "http://symfony.com/contributors" 1306 | }, 1307 | { 1308 | "name": "Fabien Potencier", 1309 | "email": "fabien@symfony.com" 1310 | } 1311 | ], 1312 | "description": "Symfony EventDispatcher Component", 1313 | "homepage": "http://symfony.com", 1314 | "time": "2014-10-01 15:43:05" 1315 | }, 1316 | { 1317 | "name": "symfony/filesystem", 1318 | "version": "v2.5.6", 1319 | "target-dir": "Symfony/Component/Filesystem", 1320 | "source": { 1321 | "type": "git", 1322 | "url": "https://github.com/symfony/Filesystem.git", 1323 | "reference": "4e62fab0060a826561c78b665925b37c870c45f5" 1324 | }, 1325 | "dist": { 1326 | "type": "zip", 1327 | "url": "https://api.github.com/repos/symfony/Filesystem/zipball/4e62fab0060a826561c78b665925b37c870c45f5", 1328 | "reference": "4e62fab0060a826561c78b665925b37c870c45f5", 1329 | "shasum": "" 1330 | }, 1331 | "require": { 1332 | "php": ">=5.3.3" 1333 | }, 1334 | "type": "library", 1335 | "extra": { 1336 | "branch-alias": { 1337 | "dev-master": "2.5-dev" 1338 | } 1339 | }, 1340 | "autoload": { 1341 | "psr-0": { 1342 | "Symfony\\Component\\Filesystem\\": "" 1343 | } 1344 | }, 1345 | "notification-url": "https://packagist.org/downloads/", 1346 | "license": [ 1347 | "MIT" 1348 | ], 1349 | "authors": [ 1350 | { 1351 | "name": "Symfony Community", 1352 | "homepage": "http://symfony.com/contributors" 1353 | }, 1354 | { 1355 | "name": "Fabien Potencier", 1356 | "email": "fabien@symfony.com" 1357 | } 1358 | ], 1359 | "description": "Symfony Filesystem Component", 1360 | "homepage": "http://symfony.com", 1361 | "time": "2014-09-22 09:14:18" 1362 | }, 1363 | { 1364 | "name": "symfony/finder", 1365 | "version": "v2.5.6", 1366 | "target-dir": "Symfony/Component/Finder", 1367 | "source": { 1368 | "type": "git", 1369 | "url": "https://github.com/symfony/Finder.git", 1370 | "reference": "cf66df4e783e6aade319b273c9bcf9e42aa9b10f" 1371 | }, 1372 | "dist": { 1373 | "type": "zip", 1374 | "url": "https://api.github.com/repos/symfony/Finder/zipball/cf66df4e783e6aade319b273c9bcf9e42aa9b10f", 1375 | "reference": "cf66df4e783e6aade319b273c9bcf9e42aa9b10f", 1376 | "shasum": "" 1377 | }, 1378 | "require": { 1379 | "php": ">=5.3.3" 1380 | }, 1381 | "type": "library", 1382 | "extra": { 1383 | "branch-alias": { 1384 | "dev-master": "2.5-dev" 1385 | } 1386 | }, 1387 | "autoload": { 1388 | "psr-0": { 1389 | "Symfony\\Component\\Finder\\": "" 1390 | } 1391 | }, 1392 | "notification-url": "https://packagist.org/downloads/", 1393 | "license": [ 1394 | "MIT" 1395 | ], 1396 | "authors": [ 1397 | { 1398 | "name": "Symfony Community", 1399 | "homepage": "http://symfony.com/contributors" 1400 | }, 1401 | { 1402 | "name": "Fabien Potencier", 1403 | "email": "fabien@symfony.com" 1404 | } 1405 | ], 1406 | "description": "Symfony Finder Component", 1407 | "homepage": "http://symfony.com", 1408 | "time": "2014-10-01 05:50:18" 1409 | }, 1410 | { 1411 | "name": "symfony/translation", 1412 | "version": "v2.5.6", 1413 | "target-dir": "Symfony/Component/Translation", 1414 | "source": { 1415 | "type": "git", 1416 | "url": "https://github.com/symfony/Translation.git", 1417 | "reference": "362fe4da2cfe587f72d57aaa2f89e6b61c05dedf" 1418 | }, 1419 | "dist": { 1420 | "type": "zip", 1421 | "url": "https://api.github.com/repos/symfony/Translation/zipball/362fe4da2cfe587f72d57aaa2f89e6b61c05dedf", 1422 | "reference": "362fe4da2cfe587f72d57aaa2f89e6b61c05dedf", 1423 | "shasum": "" 1424 | }, 1425 | "require": { 1426 | "php": ">=5.3.3" 1427 | }, 1428 | "require-dev": { 1429 | "symfony/config": "~2.0", 1430 | "symfony/intl": "~2.3", 1431 | "symfony/yaml": "~2.2" 1432 | }, 1433 | "suggest": { 1434 | "symfony/config": "", 1435 | "symfony/yaml": "" 1436 | }, 1437 | "type": "library", 1438 | "extra": { 1439 | "branch-alias": { 1440 | "dev-master": "2.5-dev" 1441 | } 1442 | }, 1443 | "autoload": { 1444 | "psr-0": { 1445 | "Symfony\\Component\\Translation\\": "" 1446 | } 1447 | }, 1448 | "notification-url": "https://packagist.org/downloads/", 1449 | "license": [ 1450 | "MIT" 1451 | ], 1452 | "authors": [ 1453 | { 1454 | "name": "Symfony Community", 1455 | "homepage": "http://symfony.com/contributors" 1456 | }, 1457 | { 1458 | "name": "Fabien Potencier", 1459 | "email": "fabien@symfony.com" 1460 | } 1461 | ], 1462 | "description": "Symfony Translation Component", 1463 | "homepage": "http://symfony.com", 1464 | "time": "2014-10-01 05:50:18" 1465 | }, 1466 | { 1467 | "name": "symfony/yaml", 1468 | "version": "v2.5.6", 1469 | "target-dir": "Symfony/Component/Yaml", 1470 | "source": { 1471 | "type": "git", 1472 | "url": "https://github.com/symfony/Yaml.git", 1473 | "reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726" 1474 | }, 1475 | "dist": { 1476 | "type": "zip", 1477 | "url": "https://api.github.com/repos/symfony/Yaml/zipball/2d9f527449cabfa8543dd7fa3a466d6ae83d6726", 1478 | "reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726", 1479 | "shasum": "" 1480 | }, 1481 | "require": { 1482 | "php": ">=5.3.3" 1483 | }, 1484 | "type": "library", 1485 | "extra": { 1486 | "branch-alias": { 1487 | "dev-master": "2.5-dev" 1488 | } 1489 | }, 1490 | "autoload": { 1491 | "psr-0": { 1492 | "Symfony\\Component\\Yaml\\": "" 1493 | } 1494 | }, 1495 | "notification-url": "https://packagist.org/downloads/", 1496 | "license": [ 1497 | "MIT" 1498 | ], 1499 | "authors": [ 1500 | { 1501 | "name": "Symfony Community", 1502 | "homepage": "http://symfony.com/contributors" 1503 | }, 1504 | { 1505 | "name": "Fabien Potencier", 1506 | "email": "fabien@symfony.com" 1507 | } 1508 | ], 1509 | "description": "Symfony Yaml Component", 1510 | "homepage": "http://symfony.com", 1511 | "time": "2014-10-01 05:50:18" 1512 | } 1513 | ], 1514 | "packages-dev": [], 1515 | "aliases": [], 1516 | "minimum-stability": "stable", 1517 | "stability-flags": { 1518 | "behat/mink-extension": 20 1519 | }, 1520 | "prefer-stable": false, 1521 | "platform": [], 1522 | "platform-dev": [] 1523 | } 1524 | -------------------------------------------------------------------------------- /features/blog.feature: -------------------------------------------------------------------------------- 1 | Feature: You can read blog posts 2 | In order to read blogs 3 | As a user 4 | I need to go to the blog 5 | 6 | Background: 7 | Given I have a vanilla wordpress installation 8 | | name | email | username | password | 9 | | BDD WordPress | walter.dalmut@gmail.com | admin | test | 10 | And there are posts 11 | | post_title | post_content | post_status | post_author | 12 | | Just my article | The content of my article | publish | 1 | 13 | | My draft | This is just a draft | draft | 1 | 14 | 15 | 16 | Scenario: List my blog posts 17 | Given I am on the homepage 18 | Then I should see "Just my article" 19 | And I should see "Hello World" 20 | And I should not see "My draft" 21 | 22 | Scenario: Read a blog post 23 | Given I am on the homepage 24 | When I follow "Just my article" 25 | Then I should see "Just my article" 26 | And I should see "The content of my article" 27 | 28 | -------------------------------------------------------------------------------- /features/bootstrap/FeatureContext.php: -------------------------------------------------------------------------------- 1 | wordpressParams = $wordpressParams; 34 | $this->minkParams = $minkParams; 35 | $this->basePath = $basePath; 36 | } 37 | 38 | /** 39 | * setup the wordpress environment / stack if the context is a wordpress context 40 | * 41 | * @param Context $context 42 | */ 43 | public function initializeContext(Context $context) 44 | { 45 | if (!$context instanceof WordPressContext) { 46 | return; 47 | } 48 | $this->prepareEnvironment(); 49 | $this->installFileFixtures(); 50 | $this->flushDatabase(); 51 | $this->loadStack(); 52 | } 53 | 54 | /** 55 | * prepare environment variables 56 | */ 57 | private function prepareEnvironment() 58 | { 59 | // wordpress uses these superglobal fields everywhere... 60 | $urlComponents = parse_url($this->minkParams['base_url']); 61 | $_SERVER['HTTP_HOST'] = $urlComponents['host'] . (isset($urlComponents['port']) ? ':' . $urlComponents['port'] : ''); 62 | $_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.1'; 63 | 64 | 65 | // we don't have a request uri in headless scenarios: 66 | // wordpress will try to "fix" php_self variable based on the request uri, if not present 67 | $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; 68 | } 69 | 70 | /** 71 | * actually load the wordpress stack 72 | */ 73 | private function loadStack() 74 | { 75 | // prevent wordpress from calling home to api.wordpress.org 76 | if (!defined('WP_INSTALLING') || !WP_INSTALLING) { 77 | define('WP_INSTALLING', true); 78 | } 79 | 80 | $finder = new Finder(); 81 | 82 | // load the wordpress "stack" 83 | $finder->files()->in($this->wordpressParams['path'])->depth('== 0')->name('wp-load.php'); 84 | 85 | foreach ($finder as $bootstrapFile) { 86 | require_once $bootstrapFile->getRealpath(); 87 | } 88 | } 89 | 90 | /** 91 | * create a wp-config.php and link plugins / themes 92 | */ 93 | public function installFileFixtures() 94 | { 95 | $finder = new Finder(); 96 | $fs = new Filesystem(); 97 | $finder->files()->in($this->wordpressParams['path'])->depth('== 0')->name('wp-config-sample.php'); 98 | foreach ($finder as $file) { 99 | $configContent = 100 | str_replace(array( 101 | "'DB_NAME', 'database_name_here'", 102 | "'DB_USER', 'username_here'", 103 | "'DB_PASSWORD', 'password_here'", 104 | "'DB_HOST', 'localhost'" 105 | ), array( 106 | sprintf("'DB_NAME', '%s'", $this->wordpressParams['connection']['db']), 107 | sprintf("'DB_USER', '%s'", $this->wordpressParams['connection']['username']), 108 | sprintf("'DB_PASSWORD', '%s'", $this->wordpressParams['connection']['password']), 109 | sprintf("'DB_HOST', '%s'", $this->wordpressParams['connection']['dbhost']), 110 | ), $file->getContents()); 111 | $fs->dumpFile($file->getPath() . '/wp-config.php', $configContent); 112 | } 113 | 114 | if (isset($this->wordpressParams['symlink']['from']) && isset($this->wordpressParams['symlink']['to'])) { 115 | $from = $this->wordpressParams['symlink']['from']; 116 | 117 | if (substr($from, 0, 1) != '/') { 118 | $from = $this->basePath . DIRECTORY_SEPARATOR . $from; 119 | } 120 | if ($fs->exists($this->wordpressParams['symlink']['from'])) { 121 | $fs->symlink($from, $this->wordpressParams['symlink']['to']); 122 | } 123 | } 124 | } 125 | 126 | /** 127 | * flush the database if specified by flush_database parameter 128 | */ 129 | public function flushDatabase() 130 | { 131 | if ($this->wordpressParams['flush_database']) { 132 | $connection = $this->wordpressParams['connection']; 133 | $mysqli = new \Mysqli( 134 | $connection['dbhost'], 135 | $connection['username'], 136 | $connection['password'], 137 | $connection['db'] 138 | ); 139 | 140 | $result = $mysqli->multi_query("DROP DATABASE IF EXISTS ${connection['db']}; CREATE DATABASE ${connection['db']};"); 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/Context/WordPressContext.php: -------------------------------------------------------------------------------- 1 | getHash()[0]; 30 | $name = $row["name"]; 31 | $username = $row["username"]; 32 | $email = $row["email"]; 33 | $password = $row["password"]; 34 | } 35 | 36 | $mysqli = new \Mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); 37 | $value = $mysqli->multi_query(implode("\n", array( 38 | "DROP DATABASE IF EXISTS " . DB_NAME . ";", 39 | "CREATE DATABASE " . DB_NAME . ";", 40 | ))); 41 | assertTrue($value); 42 | require_once ABSPATH . 'wp-admin/includes/upgrade.php'; 43 | wp_install($name, $username, $email, true, '', $password); 44 | } 45 | 46 | /** 47 | * Add these users to this wordpress installation 48 | * 49 | * @see wp_insert_user 50 | * 51 | * @Given /^there are users$/ 52 | */ 53 | public function thereAreUsers(TableNode $table) 54 | { 55 | foreach ($table->getHash() as $userData) { 56 | if (!is_int(wp_insert_user($userData))) { 57 | throw new \InvalidArgumentException("Invalid user information schema."); 58 | } 59 | } 60 | } 61 | 62 | /** 63 | * Add these posts to this wordpress installation 64 | * 65 | * @see wp_insert_post 66 | * 67 | * @Given /^there are posts$/ 68 | */ 69 | public function thereArePosts(TableNode $table) 70 | { 71 | foreach ($table->getHash() as $postData) { 72 | if (!is_int(wp_insert_post($postData))) { 73 | throw new \InvalidArgumentException("Invalid post information schema."); 74 | } 75 | } 76 | } 77 | 78 | /** 79 | * Activate/Deactivate plugins 80 | * | plugin | status | 81 | * | plugin/name.php | enabled | 82 | * 83 | * @Given /^there are plugins$/ 84 | */ 85 | public function thereArePlugins(TableNode $table) 86 | { 87 | foreach ($table->getHash() as $row) { 88 | if ($row["status"] == "enabled") { 89 | activate_plugin(WP_PLUGIN_DIR . "/" . $row["plugin"]); 90 | } else { 91 | deactivate_plugins(WP_PLUGIN_DIR . "/" . $row["plugin"]); 92 | } 93 | } 94 | } 95 | 96 | 97 | /** 98 | * Login into the reserved area of this wordpress 99 | * 100 | * @Given /^I am logged in as "([^"]*)" with password "([^"]*)"$/ 101 | */ 102 | public function login($username, $password) 103 | { 104 | $this->visit(get_site_url()."/wp-login.php"); 105 | $currentPage = $this->getSession()->getPage(); 106 | 107 | $currentPage->fillField('user_login', $username); 108 | $currentPage->fillField('user_pass', $password); 109 | $currentPage->findButton('wp-submit')->click(); 110 | 111 | assertTrue($this->getSession()->getPage()->hasContent('Dashboard')); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /src/ServiceContainer/WordPressExtension.php: -------------------------------------------------------------------------------- 1 | addDefaultsIfNotSet() 54 | ->children() 55 | ->scalarNode('path') 56 | ->defaultValue(__DIR__ . 'vendor') 57 | ->end() 58 | ->arrayNode('symlink') 59 | ->children() 60 | ->scalarNode('from') 61 | ->defaultValue('.') 62 | ->end() 63 | ->scalarNode('to') 64 | ->isRequired() 65 | ->end() 66 | ->end() 67 | ->end() 68 | ->booleanNode('flush_database') 69 | ->defaultValue(true) 70 | ->end() 71 | ->arrayNode('connection') 72 | ->children() 73 | ->scalarNode('dbhost') 74 | ->defaultValue('localhost') 75 | ->end() 76 | ->scalarNode('db') 77 | ->defaultValue('wordpress') 78 | ->end() 79 | ->scalarNode('username') 80 | ->defaultValue('root') 81 | ->end() 82 | ->scalarNode('password') 83 | ->defaultValue('') 84 | ->end() 85 | ->end() 86 | ->end() 87 | ->end(); 88 | } 89 | 90 | /** 91 | * {@inheritdoc} 92 | */ 93 | public function load(ContainerBuilder $container, array $config) 94 | { 95 | $this->loadContextInitializer($container); 96 | $container->setParameter('wordpress.parameters', $config); 97 | } 98 | 99 | /** 100 | * Register a Context Initializer service for the behat 101 | * 102 | * @param ContainerBuilder $container the service will check for Tmf\WordPressExtension\Context\WordPressContext contexts 103 | */ 104 | private function loadContextInitializer(ContainerBuilder $container) 105 | { 106 | $definition = new Definition('Tmf\WordPressExtension\Context\Initializer\WordPressContextInitializer', array( 107 | '%wordpress.parameters%', 108 | '%mink.parameters%', 109 | '%paths.base%', 110 | )); 111 | $definition->addTag(ContextExtension::INITIALIZER_TAG, array('priority' => 0)); 112 | $container->setDefinition('behat.wordpress.service.wordpress_context_initializer', $definition); 113 | } 114 | } 115 | --------------------------------------------------------------------------------