Questions tagged [mockery]

Mockery is a PHP library used to create Mocks of Objects for testing purpose.

Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).

https://github.com/padraic/mockery

529 questions
-1
votes
1 answer

how to mock parent::xxx method

Is there a way? class AAA extends BBB { public function ccc() { parent::ccc(); } } I want to check parent ccc method 1 time called
dbwhddn10
  • 103
  • 2
  • 7
-1
votes
1 answer

Passing type to SplObserver update method

I have a state object that extends a base abstract class that implements SplSubject. This state is then passed to the observers notify method however - my unit tests and IDE complain over type involved. abstract class TQ_Type implements…
Ian Wood
  • 6,515
  • 5
  • 34
  • 73
-1
votes
1 answer

PHPUnit Database testing with Mockery Framework

recently I came across Mockery Framework for PHP mock object. I have a class which has constructor which takes postgreSQL connection parameters and connects to database and other methods for DML operations. I want to write test cases for these…
Vish021
  • 399
  • 1
  • 5
  • 18
-1
votes
1 answer

Testing a class that calls parent::function?

I have a model that overloads the where function. My overloaded method looks like this: public function where($column, $operator = null, $value = null, $boolean = 'and') { if (in_array($column, $this->metaFields)) { $value = '%"'…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
1 2 3
35
36