Skip to content

Instantly share code, notes, and snippets.

@ceeram
Last active December 14, 2015 08:49
Show Gist options
  • Save ceeram/5060990 to your computer and use it in GitHub Desktop.
Save ceeram/5060990 to your computer and use it in GitHub Desktop.
dataProvider outside test class
<?php
/**
* Provider Test Case
*
*/
class ProviderTest extends PHPUnit_Framework_TestCase {
/**
*
* @dataProvider ProviderCollection::provider
*/
public function testClassProvider($arg) {
$this->assertEquals(true, $arg);
}
}
class ProviderCollection {
/**
* dataProvider for ProviderTest::testClassProvider()
*
*/
public function provider() {
return array(
array(1),
array(true)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment