Giter Site home page Giter Site logo

monkery-test-case's People

Contributors

alexp11223 avatar bueltge avatar dnaber-de avatar websupporter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

media-store-net

monkery-test-case's Issues

Mockery version 1.0

Mockery is now available in version 1.0
As far as I can see it Brain/Monkey can use version 1.0 (Brain-WP/BrainMonkey@02bf838)

If possible, can we remove the restriction for version ^0.9.9?

$ composer why mockery/mockery
brain/monkey               2.2.0  requires  mockery/mockery (>=0.9 <2)  
inpsyde/monkery-test-case  4.0.0  requires  mockery/mockery (^0.9.9) 

My current problem:

$discontinuedStatus = \Mockery::mock(DocumentStatus::class);
$discontinuedStatus
    ->shouldReceive('__toString')
    ->andReturn(DocumentStatus::STATUS_DISCONTINUED);

gives me this error:

PHP Fatal error:  Declaration of Mockery_6_Types_DocumentStatus::__toString() must be compatible with \Types\DocumentStatus::__toString(): string

Mockery seems to be able to handle this in 1.0.

How to setup brain monkey + mockery at once?

Seems isn't possible to create a class that setup both mockery and brain monkey.

Any reason why not use just one class since brain/monkey require mockery too?

Something like

use Brain\Monkey;
use Mockery;
use PHPUnit\Framework\TestCase as PhpUnitTestCase;

/**
 * Class Testcase
 */
class TestCase extends PhpUnitTestCase
{
    /**
     * Sets up the fixture, for example, open a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        parent::setUp();
        Monkey\setUp();
    }

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
        parent::tearDown();
        Mockery::close();
        Monkey\tearDown();
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.