marcofiset / Testify.php

A micro unit testing framework
http://marco-fiset.github.com/Testify.php/
129 stars 27 forks source link

ArrayAccess #2

Closed netzhuffle closed 11 years ago

netzhuffle commented 12 years ago

Implementing ArrayAccess to get a more intuitive way to store variables: $tf["calc"] = new MyCalc(10); $calc = $tf["calc"];

Instead of: $tf->data->calc = new MyCalc(10); $calc = $tf->data->calc;

$tf->data is still there for backward compatibility, but set to deprecated.

martinaglv commented 12 years ago

Great job! However it isn't as clean as I envisioned it - there is something in treating the Testify object as a hash that doesn't feel quite right.

But I agree that array access is shorter and more convenient. So as a compromise solution, I think about keeping $tf->data and using array access as an alternative.

netzhuffle commented 12 years ago

So it would be the best to use Testify::data also for array access instead of a new Testify::storedData.

marcofiset commented 11 years ago

Hi @netzhuffle, I recently inherited the ownership of this project, and unfortunately, I don't feel like this feature really adds any value to the project. I agree with martin's comment that it does not feel right. I know it's been a long time since you submitted this and you might not even remember, but feel free to contribute any other ideas that you have for the project!