bag2/doppel

Test double implementation for static methods

Maintainers

👁 zonuexe

Package info

github.com/bag2php/doppel

pkg:composer/bag2/doppel

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2021-03-21 18:15 UTC

Requires

  • php: >=7.3

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MPL-2.0 aaf0cb08e4544a60f4f7b2e06715ce363eef6538

This package is auto-updated.

Last update: 2026-06-17 17:08:40 UTC


README

👁 Build Status
👁 Infection MSI

Doppel is a PHP mocking framework for static methods.

Example

<?php

class Vehicle {
 public static function horn() {
 return 'Beep!';
 }
}

echo Vehicle::horn(), PHP_EOL; // Beep!

$doppel = (new Bag2\Doppel\Factory)->create();
$doppel->add('Vehicle::horn')->andReturn('Boo!');

echo Vehicle::horn(), PHP_EOL; // Boo!

$doppel->finalize();

echo Vehicle::horn(), PHP_EOL; // Beep!

Copyright

This package is licenced under Mozilla Public License Version 2.0.

Copyright 2020 Baguette HQ

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.