Skip to content

Instantly share code, notes, and snippets.

🍺
Codes for beer

Jakub Zalas jakzal

Block or report user

Report or block jakzal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SearchPage.php
<?php declare(strict_types=1);
use Behat\Mink\Element\NodeElement;
use Behat\Mink\Session;
use Zalas\PageObject\Annotation\FindBy;
use Zalas\PageObject\Annotation\MinkSession;
class SearchPage
{
/**
@jakzal
jakzal / DoublesTest.php
Last active Sep 26, 2018
Test double examples
View DoublesTest.php
<?php declare(strict_types=1);
namespace App\Tests\Doubles;
use PHPUnit\Framework\TestCase;
class Item
{
}
@jakzal
jakzal / MockerTest.php
Last active Jul 27, 2018
[Idea] Automated injection of test doubles into phpunit test cases
View MockerTest.php
<?php
declare(strict_types=1);
namespace Zalas\Injector\Tests\Service;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Zalas\Injector\PHPUnit\TestCase\ServiceContainerTestCase;
View keybase.md

Keybase proof

I hereby claim:

  • I am jakzal on github.
  • I am jakubzalas (https://keybase.io/jakubzalas) on keybase.
  • I have a public key ASDymt67mEWq_8pwxEXefRL4POa25z_680ovmggZWKTKHQo

To claim this, I am signing this object:

@jakzal
jakzal / DataSet.php
Created Jun 12, 2018
Execute your markdown specs
View DataSet.php
<?php
declare(strict_types=1);
namespace Zalas\Test\MarkdownSpec;
class DataSet implements \IteratorAggregate
{
/**
* @var array
*/
@jakzal
jakzal / war.sc
Last active May 14, 2018
War Card Game in Scala
View war.sc
sealed trait Suit
sealed case class Hearts() extends Suit {
override def toString = ""
}
sealed case class Diamonds() extends Suit {
override def toString = ""
}
sealed case class Clubs() extends Suit {
override def toString = ""
}
@jakzal
jakzal / SymfonyKernel.php
Created Mar 2, 2018
Replacement for Symfony's KernelTestCase
View SymfonyKernel.php
<?php
declare(strict_types=1);
namespace Zalas\PHPUnit\Injector\Symfony\TestCase;
use Symfony\Component\DependencyInjection\ResettableContainerInterface;
use Symfony\Component\HttpKernel\KernelInterface;
/**
* Mimics the behaviour of Symfony's KernelTestCase.
@jakzal
jakzal / flat_map.php
Last active Feb 24, 2018
Flat map in PHP
View flat_map.php
<?php
function flat_map(callable $callback, array $collection) {
return array_merge([], ...array_map($callback, $collection));
};
@jakzal
jakzal / ExampleTest.php
Last active Mar 1, 2018
Set global variables with PHPUnit test method annotations
View ExampleTest.php
<?php
declare(strict_types=1);
namespace Zalas\Tests;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
/**
@jakzal
jakzal / QueueScraperTest.php
Last active Mar 6, 2019
RabbitMQ integration test
View QueueScraperTest.php
<?php
namespace Zalas\Infrastructure\Scraper;
use OldSound\RabbitMqBundle\RabbitMq\Consumer;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface;
use PhpAmqpLib\Connection\AbstractConnection;
use PhpAmqpLib\Connection\AMQPLazyConnection;
use PhpAmqpLib\Exception\AMQPTimeoutException;
You can’t perform that action at this time.