diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..0566089 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +out/* +/composer.phar +/bin/ +/vendor/ diff --git a/README.md b/README.md old mode 100644 new mode 100755 index d5414e6..da930d6 --- a/README.md +++ b/README.md @@ -38,16 +38,111 @@ Not yet, we're hoping to add templating - all contributions welcome! ## Screenshots +##Development + +###Directory structure + Versioned files +``` + -+ / + + doc/ Docs files + + features/ Behat feature files and bootstrap + + src/ Module source files + + css/ Styles + + languages/ Locale .mo and .po files + + tools/ Automated plugin packager scripts +``` + + Not versioned files (autogenerated). +``` + -+ / + + bin/ Behat binaries. Generated by composer. + + out/ The module package to deploy. Generated by tools/release script. + + vendor/ Useful libraries. Generated by composer. +``` + +###Internationalization + Only .po files must be updated. Filename format is **githubembed-*LANGUAGE CODE*.po**, for example: *githubembed-es_ES.po* + + To generate .mo files use +```shell + ./tools/generate_mo_files +``` + +###Deploy + Use *release* script to generate the plugin package +```shell + ./tools/release +``` + + The package files .zip and .tar.gz will be in *out/* directory + +###Recommended environment +####Testing server +1. Install and configure two english Wordpress sites running at http://localhost/sandbox/wordpress/simply/ and http://localhost/sandbox/wordpress/multisite/ + + If you prefer other location, change the *behat.yml* file. +```yml + base_url: http://localhost/sandbox/wordpress +``` + +**Wordpress admin must be in english for BDD tests** + +2. Create a admin user named *test* which email *test@test.test* and password *testtest*. Set Administrator profile to this user. + + If you prefer other other test user credentials, change the *features/bootstrap/FeatureContext.php*] file. +```php + define('WORDPRESS_ADMIN_USER', 'test'); + define('WORDPRESS_ADMIN_PASSWORD', 'testtest'); +``` + +3. Configure the http://localhost/sandbox/wordpress/multisite/ as multisite, check the Codex for more info on this topic: [Create_A_Network](http://codex.wordpress.org/Create_A_Network) + +4. Create a blog named *test1* in http://localhost/sandbox/wordpress/multisite/test1/ + +5. Link src project directory to your Wordperfect site plugins directory +```shell + ln -s /home/developer/projects/wp-github-oembed/src/ /var/www/sandbox/wordpress/simply/wp-content/plugins/github-embed + ln -s /home/developer/projects/wp-github-oembed/src/ /var/www/sandbox/wordpress/multisite/wp-content/plugins/github-embed +``` + + +####BDD +Use [Composer](http://getcomposer.org/) to install [Behat](http://behat.org) and all necesary files. +```shell + curl -s https://getcomposer.org/installer | php + ./composer.phar install +``` + +You can test the development environment configuration +```shell + ./bin/behat features/enviroment/ +``` + +Run all tests +```shell + ./bin/behat +``` + +Run all tests for simply wordpress +```shell + ./bin/behat features/simply/ +``` + +Run all tests for multisite wordpress +```shell + ./bin/behat features/multisite/ +``` + +**Wordpress admin must be in english for BDD tests** ## Changelog - 1.3 - Expire the oEmbed cache daily - - 1.2 - Support for milestone summaries - Support for contributor lists - 1.1 - Default CSS and more styling - 1.0 - - First release + - First release diff --git a/behat.yml b/behat.yml new file mode 100755 index 0000000..2808bc5 --- /dev/null +++ b/behat.yml @@ -0,0 +1,7 @@ +default: + extensions: + Behat\MinkExtension\Extension: + base_url: http://localhost/sandbox/wordpress + goutte: ~ + selenium2: ~ + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..37181a2 --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "require": { + "behat/behat": "2.4.*@stable", + "behat/mink": "1.4.*@stable", + "behat/mink-extension": "*", + "behat/mink-goutte-driver": "*", + "behat/mink-selenium2-driver": "*" + }, + "config": { + "bin-dir": "bin/" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..bbfac2e --- /dev/null +++ b/composer.lock @@ -0,0 +1,1177 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + ], + "hash": "933d459b997a509de59153a3f870132d", + "packages": [ + { + "name": "behat/behat", + "version": "v2.4.5", + "source": { + "type": "git", + "url": "git://github.com/Behat/Behat.git", + "reference": "v2.4.5" + }, + "dist": { + "type": "zip", + "url": "https://github.com/Behat/Behat/archive/v2.4.5.zip", + "reference": "v2.4.5", + "shasum": "" + }, + "require": { + "behat/gherkin": ">=2.2.4,<2.3-dev", + "php": ">=5.3.1", + "symfony/config": ">=2.0,<2.3-dev", + "symfony/console": ">=2.0,<2.3-dev", + "symfony/dependency-injection": ">=2.0,<2.3-dev", + "symfony/event-dispatcher": ">=2.0,<2.3-dev", + "symfony/finder": ">=2.0,<2.3-dev", + "symfony/translation": ">=2.0,<2.3-dev", + "symfony/yaml": ">=2.0,<2.3-dev" + }, + "suggest": { + "behat/mink-extension": "for integration with Mink testing framework", + "behat/symfony2-extension": "for integration with Symfony2 web framework", + "behat/yii-extension": "for integration with Yii web framework" + }, + "bin": [ + "bin/behat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Behat": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Scenario-oriented BDD framework for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "Symfony2" + ], + "time": "2013-01-27 14:45:41" + }, + { + "name": "behat/gherkin", + "version": "v2.2.9", + "source": { + "type": "git", + "url": "https://github.com/Behat/Gherkin.git", + "reference": "v2.2.9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/v2.2.9", + "reference": "v2.2.9", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/finder": ">=2.0,<2.4-dev" + }, + "require-dev": { + "symfony/config": ">=2.0,<2.4-dev", + "symfony/translation": ">=2.0,<2.4-dev", + "symfony/yaml": ">=2.0,<2.4-dev" + }, + "suggest": { + "symfony/config": "If you want to use Config component to manage resources", + "symfony/translation": "If you want to use Symfony2 translations adapter", + "symfony/yaml": "If you want to parse features, represented in YAML files" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Gherkin": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Gherkin DSL parser for PHP 5.3", + "homepage": "http://behat.org/", + "keywords": [ + "BDD", + "Behat", + "DSL", + "Symfony2", + "parser" + ], + "time": "2013-03-02 10:38:40" + }, + { + "name": "behat/mink", + "version": "v1.4.3", + "source": { + "type": "git", + "url": "https://github.com/Behat/Mink.git", + "reference": "v1.4.3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/Mink/zipball/v1.4.3", + "reference": "v1.4.3", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": ">=2.0,<2.4-dev" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Web acceptance testing framework for PHP 5.3", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2013-03-02 15:53:18" + }, + { + "name": "behat/mink-browserkit-driver", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkBrowserKitDriver.git", + "reference": "v1.0.5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkBrowserKitDriver/zipball/v1.0.5", + "reference": "v1.0.5", + "shasum": "" + }, + "require": { + "behat/mink": ">=1.4.3,<1.5", + "php": ">=5.3.1", + "symfony/browser-kit": ">=2.0,<3.0", + "symfony/dom-crawler": ">=2.0,<3.0" + }, + "require-dev": { + "silex/silex": "@dev" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink\\Driver": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Symfony2 BrowserKit driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "Mink", + "Symfony2", + "browser", + "testing" + ], + "time": "2013-04-13 12:17:15" + }, + { + "name": "behat/mink-extension", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkExtension.git", + "reference": "v1.1.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/v1.1.0", + "reference": "v1.1.0", + "shasum": "" + }, + "require": { + "behat/behat": ">=2.4.5,<2.5", + "behat/mink": ">=1.4.3,<1.6-dev", + "php": ">=5.3.2" + }, + "require-dev": { + "behat/mink-goutte-driver": ">=1.0,<2.0" + }, + "type": "behat-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\MinkExtension": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Mink extension for Behat", + "homepage": "http://mink.behat.org", + "keywords": [ + "browser", + "gui", + "test", + "web" + ], + "time": "2013-05-23 12:32:57" + }, + { + "name": "behat/mink-goutte-driver", + "version": "v1.0.8", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkGoutteDriver.git", + "reference": "v1.0.8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkGoutteDriver/zipball/v1.0.8", + "reference": "v1.0.8", + "shasum": "" + }, + "require": { + "behat/mink-browserkit-driver": ">=1.0.5,<1.2.0", + "fabpot/goutte": ">=1.0.1,<1.1", + "php": ">=5.3.1" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink\\Driver": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Goutte driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "goutte", + "headless", + "testing" + ], + "time": "2013-04-13 23:30:23" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/Behat/MinkSelenium2Driver.git", + "reference": "v1.0.6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Behat/MinkSelenium2Driver/zipball/v1.0.6", + "reference": "v1.0.6", + "shasum": "" + }, + "require": { + "behat/mink": ">=1.4.3,<1.5", + "instaclick/php-webdriver": ">=1.0.12.0,<1.1", + "php": ">=5.3.1" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Behat\\Mink\\Driver": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2013-04-13 12:56:28" + }, + { + "name": "fabpot/goutte", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Goutte.git", + "reference": "v1.0.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Goutte/zipball/v1.0.1", + "reference": "v1.0.1", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "guzzle/guzzle": ">=3.0, <3.4", + "php": ">=5.3.0", + "symfony/browser-kit": ">=2.1,<3.0", + "symfony/css-selector": ">=2.1,<3.0", + "symfony/dom-crawler": ">=2.1,<3.0", + "symfony/finder": ">=2.1,<3.0", + "symfony/process": ">=2.1,<3.0" + }, + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Goutte": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/fabpot/Goutte", + "keywords": [ + "scraper" + ], + "time": "2013-03-08 08:00:58" + }, + { + "name": "guzzle/guzzle", + "version": "v3.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "v3.3.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/v3.3.1", + "reference": "v3.3.1", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2", + "symfony/event-dispatcher": ">=2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" + }, + "require-dev": { + "doctrine/cache": "*", + "monolog/monolog": "1.*", + "phpunit/phpunit": "3.7.*", + "symfony/class-loader": "*", + "zend/zend-cache1": "1.12", + "zend/zend-log1": "1.12", + "zendframework/zend-cache": "2.0.*", + "zendframework/zend-log": "2.0.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-0": { + "Guzzle\\Tests": "tests/", + "Guzzle": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2013-03-10 23:05:38" + }, + { + "name": "instaclick/php-webdriver", + "version": "1.0.12", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "1.0.12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/1.0.12", + "reference": "1.0.12", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/torontotechjobs/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2013-02-19 18:37:07" + }, + { + "name": "symfony/browser-kit", + "version": "v2.2.1", + "target-dir": "Symfony/Component/BrowserKit", + "source": { + "type": "git", + "url": "https://github.com/symfony/BrowserKit.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/dom-crawler": ">=2.0,<3.0" + }, + "require-dev": { + "symfony/css-selector": ">=2.0,<3.0", + "symfony/process": ">=2.0,<3.0" + }, + "suggest": { + "symfony/process": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\BrowserKit\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony BrowserKit Component", + "homepage": "http://symfony.com", + "time": "2013-03-15 10:14:31" + }, + { + "name": "symfony/config", + "version": "v2.2.1", + "target-dir": "Symfony/Component/Config", + "source": { + "type": "git", + "url": "https://github.com/symfony/Config.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "http://symfony.com", + "time": "2013-03-01 10:42:10" + }, + { + "name": "symfony/console", + "version": "v2.2.1", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2013-03-19 20:48:08" + }, + { + "name": "symfony/css-selector", + "version": "v2.2.1", + "target-dir": "Symfony/Component/CssSelector", + "source": { + "type": "git", + "url": "https://github.com/symfony/CssSelector.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\CssSelector\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "http://symfony.com", + "time": "2013-01-17 15:25:59" + }, + { + "name": "symfony/dependency-injection", + "version": "v2.2.1", + "target-dir": "Symfony/Component/DependencyInjection", + "source": { + "type": "git", + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": ">=2.2,<2.3-dev", + "symfony/yaml": ">=2.0,<3.0" + }, + "suggest": { + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DependencyInjection\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "http://symfony.com", + "time": "2013-03-23 07:49:54" + }, + { + "name": "symfony/dom-crawler", + "version": "v2.2.1", + "target-dir": "Symfony/Component/DomCrawler", + "source": { + "type": "git", + "url": "https://github.com/symfony/DomCrawler.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/css-selector": ">=2.0,<3.0" + }, + "suggest": { + "symfony/css-selector": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\DomCrawler\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "http://symfony.com", + "time": "2013-04-01 08:05:23" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.2.1", + "target-dir": "Symfony/Component/EventDispatcher", + "source": { + "type": "git", + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/dependency-injection": ">=2.0,<3.0" + }, + "suggest": { + "symfony/dependency-injection": "2.2.*", + "symfony/http-kernel": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "http://symfony.com", + "time": "2013-02-11 11:26:43" + }, + { + "name": "symfony/finder", + "version": "v2.2.1", + "target-dir": "Symfony/Component/Finder", + "source": { + "type": "git", + "url": "https://github.com/symfony/Finder.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Finder/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Finder\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "http://symfony.com", + "time": "2013-04-01 07:51:50" + }, + { + "name": "symfony/process", + "version": "v2.2.1", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com", + "time": "2013-03-23 07:49:54" + }, + { + "name": "symfony/translation", + "version": "v2.2.1", + "target-dir": "Symfony/Component/Translation", + "source": { + "type": "git", + "url": "https://github.com/symfony/Translation.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Translation/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "symfony/config": ">=2.0,<2.3-dev", + "symfony/yaml": ">=2.2,<3.0" + }, + "suggest": { + "symfony/config": "2.2.*", + "symfony/yaml": "2.2.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "http://symfony.com", + "time": "2013-04-01 08:06:05" + }, + { + "name": "symfony/yaml", + "version": "v2.2.1", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "v2.2.1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.2.1", + "reference": "v2.2.1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com", + "time": "2013-03-23 07:49:54" + } + ], + "packages-dev": [ + + ], + "aliases": [ + + ], + "minimum-stability": "stable", + "stability-flags": { + "behat/behat": 0, + "behat/mink": 0 + }, + "platform": [ + + ], + "platform-dev": [ + + ] +} diff --git a/banner-772x250.png b/doc/banner-772x250.png similarity index 100% rename from banner-772x250.png rename to doc/banner-772x250.png diff --git a/readme.txt b/doc/readme.txt similarity index 100% rename from readme.txt rename to doc/readme.txt diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php new file mode 100755 index 0000000..74e39a8 --- /dev/null +++ b/features/bootstrap/FeatureContext.php @@ -0,0 +1,261 @@ +getSession()->getCurrentURL())) { + return false; + } else { + return true; + } + } + + private function setTestPostURL($value) + { + if ($this->isMultisite()) { + self::$testPostURLSimply = $value; + } else { + self::$testPostURLMultisite = $value; + } + } + + private function getTestPostURL() + { + if ($this->isMultisite()) { + return self::$testPostURLSimply; + } else { + return self::$testPostURLMultisite; + } + } + + /** + * @Given /^I am on simply homepage$/ + */ + public function iAmOnSimplyHomepage() + { + $this->getSession()->visit($this->locatePath(WORDPRESS_SIMPLY_HOME)); + } + + /** + * @Given /^I am on multisite homepage$/ + */ + public function iAmOnMultisiteHomepage() + { + $this->getSession()->visit($this->locatePath(WORDPRESS_MULTISITE_HOME)); + } + + /** + * @Given /^I am on simply admin home$/ + */ + public function iAmOnSimplyAdminHome() + { + $this->getSession()->visit($this->locatePath(WORDPRESS_SIMPLY_ADMIN)); + } + + /** + * @Given /^I am on multisite admin home$/ + */ + public function iAmOnMultisiteAdminHome() + { + $this->getSession()->visit($this->locatePath(WORDPRESS_MULTISITE_ADMIN)); + } + + /** + * @When /^I am logged in$/ + */ + public function iAmLoggedIn() + { + $this->getSession()->getPage()->find('css', 'input[name="log"]')->setValue(WORDPRESS_ADMIN_USER); + $this->getSession()->getPage()->find('css', 'input[name="pwd"]')->setValue(WORDPRESS_ADMIN_PASSWORD); + $this->getSession()->getPage()->find('css', 'input[name="wp-submit"]')->click(); + } + + /** + * @When /^I go to admin plugins page$/ + */ + public function iGoToAdminPluginsPage() + { + $this->getSession()->getPage()->find('xpath', '//a[text()="Installed Plugins"]')->click(); + } + + /** + * @Given /^plugin must be activated$/ + */ + public function pluginMustBeActivated() + { + $this->iGoToAdminPluginsPage(); + $flag = $this->getSession()->getPage()->find('css', '#github-embed .activate'); + if (!is_null($flag)) { + $this->getSession()->getPage()->find('css', '#github-embed .activate a')->click(); + } + } + + /** + * @Given /^plugin must be deactivated$/ + */ + public function pluginMustBeDeactivated() + { + $this->iGoToAdminPluginsPage(); + $flag = $this->getSession()->getPage()->find('css', '#github-embed .deactivate'); + if (!is_null($flag)) { + $this->getSession()->getPage()->find('css', '#github-embed .deactivate a')->click(); + } + } + + /** + * @Given /^test post must be created$/ + */ + public function testPostMustBeCreated() + { + if (!$this->getTestPostURL()) { + $this->createPost(); + } + } + + /** + * Fill post form + */ + private function setPostContent() { + $this->getSession()->getPage()->find('css', 'input[name="post_title"]')->setValue(WORDPRESS_POST_TITLE); + $this->getSession()->getPage()->find('css', 'textarea[name="content"]')->setValue(" +