-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDataProvider.php
More file actions
33 lines (28 loc) · 871 Bytes
/
Copy pathDataProvider.php
File metadata and controls
33 lines (28 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace QCheck;
class DataProviderTest extends \PHPUnit_Framework_TestCase {
function provider($name, $n = 10) {
return DataProvider::provider(array(
Generator::strings(),
Generator::ints(),
Generator::booleans()
), $n);
}
/**
* @dataProvider provider
*/
function testDataProvider($s, $i, $b) {
// this test is only supposed to prove that we have a valid provider
$this->assertTrue(is_string($s));
$this->assertTrue(is_int($i));
$this->assertTrue(is_bool($b));
}
function testDataProviderCount() {
$numbers = array(1, 10, 50);
foreach($numbers as $n) {
$data = $this->provider('testDataProviderCount', $n);
$this->assertCount($n, $data);
$this->assertCount(3, $data[0]);
}
}
}