hoaproject / Option

The Hoa\Option library.
https://hoa-project.net/
9 stars 3 forks source link

atoum extension for this lib? #17

Open Grummfy opened 6 years ago

Grummfy commented 6 years ago

Hello, I think we could create an extension for atoum with specific assert like

$this->option($this->newTestedInstance->someValue())->isSome;
$this->option($this->newTestedInstance->someValue())->isNone;
$this->option($this->newTestedInstance->someValue())->isSome->boolean->isTrue;
// ...
Hywan commented 6 years ago

Hello,

Why not. What is the pros and cons of using it? How to install it? Who will maintain it :-)?

Grummfy commented 6 years ago

I will be happy to do it, under the flag of hoa. Just not sure what assertion to create.

Install il like any other atoum extension : composer require

Hywan commented 6 years ago

Go :-).

Grummfy commented 6 years ago

Except the fact that we want something like

$this->option($this->newTestedInstance->someValue())->isSome;
$this->option($this->newTestedInstance->someValue())->isNone;

and we want to be able to make assertion on the value inside, do you see anything else to take into account?

Hywan commented 6 years ago

Nop. Just extend boolean. And isSome must be equivalent to isSome() etc.

Grummfy commented 6 years ago

here it is : https://github.com/Grummfy/atoum-option-extension

Pierozi commented 6 years ago

@Grummfy code looks good to me 👍 Have you tried to run a build on travis?

just a little tabulation here : https://github.com/Grummfy/atoum-option-extension/blob/master/composer.json#L13