2017 © Pedro Peláez
 

library hackmock

Mocking framework for hacklang

image

usox/hackmock

Mocking framework for hacklang

  • Sunday, July 22, 2018
  • by usox
  • Repository
  • 1 Watchers
  • 2 Stars
  • 175 Installations
  • Hack
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 573 % Grown

The README.md

Build Status, (*1)

HackMock

Creating mock objects for hacklang - yes, seriously., (*2)

Note

Due to the use of eval, hackmock may stop working in future hhvm versions., (*3)

What works?

  • Strict mode
  • Creating mocks of interfaces and concrete classes
  • Defining basic method expectations (parameter validation, return value definition)

What does not work?

  • Everything else, especially rare and/or untested cases involving generics, etc.
use function Usox\HackMock\{mock, prospect};

class SomethingTest extends \Usox\HackMock\HackMock {

  public function testSomething() {
    $my_fine_class = mock(SomeInterface::class);

    prospect($my_fine_class, 'someMethodName')
      ->once()
      ->andReturn('some-fine-value');

    prospect($my_fine_class, 'someOtherMethodName')
      ->andThrow(new \Exception('foobar'));
  }
}

The Versions

22/07 2018

dev-master

9999999-dev https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

20/06 2018

v0.1.8

0.1.8.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

19/06 2018

v0.1.7

0.1.7.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

19/06 2018

v0.1.5

0.1.5.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

19/06 2018

v0.1.4

0.1.4.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

19/06 2018

v0.1.3

0.1.3.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

19/06 2018

v0.1.2

0.1.2.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

19/06 2018

v0.1.1

0.1.1.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang

02/06 2018

v0.1.0

0.1.0.0 https://github.com/usox/hackmock

Mocking framework for hacklang

  Sources   Download

MIT

The Requires

 

The Development Requires

mock testing hack hhvm hacklang