Skip to content

Instantly share code, notes, and snippets.

View DavertMik's full-sized avatar
🤓
developing codeception & codeceptjs

Michael Bodnarchuk DavertMik

🤓
developing codeception & codeceptjs
View GitHub Profile
@DavertMik
DavertMik / gist:ecbb0f80adecf0106c04
Created July 9, 2015 10:31
Facebook WebDriver aliases for moving from 0.6 => 1.0
<?php
class RemoteWebDriver extends \Facebook\WebDriver\Remote\RemoteWebDriver {};
class InvalidSelectorException extends Facebook\WebDriver\Exception\InvalidSelectorException {};
class NoSuchElementException extends Facebook\WebDriver\Exception\NoSuchElementException {};
class WebDriverCurlException extends Facebook\WebDriver\Exception\WebDriverCurlException {};
class WebDriverActions extends Facebook\WebDriver\Interactions\WebDriverActions {};
class LocalFileDetector extends Facebook\WebDriver\Remote\LocalFileDetector {};
class WebDriverCapabilityType extends Facebook\WebDriver\Remote\WebDriverCapabilityType {};
class WebDriverAlert extends Facebook\WebDriver\WebDriverAlert {};
class WebDriverBy extends Facebook\WebDriver\WebDriverBy {};
@DavertMik
DavertMik / Meetup.md
Last active January 21, 2016 05:25
Codeception Kyiv Meetup

Codeception Kyiv Meetup on July 1st, 20:00 Bierstube Pub. http://lh.com.ua/bierstube.html

Мы проводим первый митап разработчиков и пользователей Codeception. Обсудим новый релиз 2.1, поговорим о том как лучше тестировать PHP проекты и просто пообщаемся.

Встреча будет проходить 1 июля в 20:00 в пабе Бирштубе на Льва Толстого. http://lh.com.ua/bierstube.html Приходите, будем рады увидеть всех кто интересуется темой тестирования в PHP.

спрашивать столик на фамилию Шупило

@DavertMik
DavertMik / robo.md
Last active August 17, 2016 10:15
Robo 0.5 changes

Robo Changes

  1. Tasks are located by following PSR-4 standard
  2. Task loading by traits are removed - this is done to simplify loading of tasks. Instead of declaring tasks in traits you can just call them with static initialization methods. Also you won't need to include lots of traits into RoboFile. Usage of static class calls instead of traits is aimed for simplicity. One task = one class = one file.
  3. Tasks initialization syntax changed to
<?php

taskChangelog::init()
@DavertMik
DavertMik / gist:7969053
Created December 15, 2013 04:53
EmailTestCase for testing emails with MailCatcher in PHPUnit
<?php
class EmailTestCase extends PHPUnit_Framework_TestCase {
/**
* @var \Guzzle\Http\Client
*/
private $mailcatcher;
public function setUp()
{
@DavertMik
DavertMik / пороблено.php.ua
Last active December 29, 2015 14:49
Отак ми кодимо на Вкраїні!
<?php
клас Користувач {
функція вкзIм'я($ім'я)
{
$це->ім'я = $ім'я ;
}
}
<?php
require_once 'php-webdriver/lib/__init__.php';
$start = time();
$capabilities = array(WebDriverCapabilityType::BROWSER_NAME => 'firefox');
$driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities);
$driver->get("http://yopolis.ru/site/login");
@DavertMik
DavertMik / gist:6043065
Last active December 20, 2015 00:39
The power of AspectMock framework
<?php
// Can your mocking framework do this? ;)
$this->assertEquals('users', UserModel::tableName());
double::registerClass('\demo\UserModel', ['tableName' => 'my_users']);
$this->assertEquals('my_users', UserModel::tableName());
@DavertMik
DavertMik / gist:5953203
Last active December 19, 2015 12:09
Comments in Codeception 1.6.4
<?php
$I = new TestGuy($scenario);
$I->am('business analyst');
$I->wantTo('say what have to be done');
$I->lookForwardTo('you do it well, and then you get it tested');
$I['think there should be a T-Shirt shop'];
$I['where I can pick a shirt of my size and order it'];
$I['site will suggest me the nearest place to my location'];
$I['will be charged immediately'];
@DavertMik
DavertMik / gist:5654009
Last active December 17, 2015 18:29
Isert library concept. More BDD styled assertions for PHPUnit/Codeception.
<?php
I\see($user)->is('User');
I\see($string)->equals('hello');
I\see($user_names)->contains('davert');
I\see("Hello world")->contains('Hello');
I\expect(function() {
$user->save();
})->throwsException('NotAllowedException');