Skip to content

Commit

Permalink
Update ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Aug 6, 2023
1 parent ef89556 commit 9406099
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ with `zip()`, `join()`, `cross()`, `pairs()`, `slice()` and more.
* [Functionalities](#functionalities)
* [Features](#features)
* [Example](#example-usage)
* [Advanced example](#advanced-usage)
3. [Migration](#migration-from-previous-version)

# Installation
Expand Down Expand Up @@ -140,6 +141,70 @@ public function services(): DataProvider {
}
```

### Advanced usage

```php
/**
* @test
* @dataProvider urls
*/
public function test0(string $url): void {
// your test here
}

/**
* @test
* @dataProvider services
*/
public function test1(string $url, string $name, string $method, int $port): void {
// your test here
}

/**
* @test
* @dataProvider allServices
*/
public function test2(string $url, string $name, string $method, int $port): void {
// your test here
}

public function urls(): DataProvider {
return DataProvider::list('github.com', 'bitbucket.com', 'gitlab.com', 'sourceforge.net');
}

public function rawArrayProvider(): array {
return [
['GitHub'],
['BitBucket'],
['GitLab'],
['SourceForge']
];
}

public function services(): DataProvider {
return DataProvider::cross(
DataProvider::zip($this->urls(), $this->rawArrayProvider()),
DataProvider::sets(
['http', 80],
['https', 443],
['ssh', 22])
);
}

public function allServices(): DataProvider {
return DataProvider::join(
$this->services(),
$this->localServices()
);
}

public function localServices(): array {
return [
['localhost', 'local', 'http', '80']
];
}
```

# Migration from previous version

To use version `3.0.0`, migrating from [`2.4.0`][previous] or earlier:
Expand Down

0 comments on commit 9406099

Please sign in to comment.