Skip to content

Instantly share code, notes, and snippets.

@malkusch
Last active September 20, 2015 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malkusch/c7005a1abaa35f2afba9 to your computer and use it in GitHub Desktop.
Save malkusch/c7005a1abaa35f2afba9 to your computer and use it in GitHub Desktop.
<?php
interface Foo
{
public function bar();
}
class BackupStaticAttributesTest extends \PHPUnit_Framework_TestCase
{
/**
* @backupStaticAttributes disabled
* @test
*/
public function testNoBackupFirst()
{
$foo = \Mockery::mock(Foo::class);
$foo->shouldReceive("bar")->andReturn("bar");
$this->assertEquals("bar", $foo->bar());
}
/**
* @test
* @backupStaticAttributes enabled
* @dataProvider provideTestBackupStaticAttributes
* @depends testNoBackupFirst
*/
public function testBackupStaticAttributes()
{
$foo = \Mockery::mock(Foo::class);
$foo->shouldReceive("bar")->andReturn("bar");
$this->assertEquals("bar", $foo->bar());
}
public function provideTestBackupStaticAttributes()
{
return [
[],
[]
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment