« first day (2680 days earlier)      last day (2271 days later) » 
00:00 - 22:0022:00 - 00:00

10:08 PM
@Alesana the company that makes Magento, or working for a business that uses Magento?
 
A business that uses Magento, sorry haha
The exercise says "One script file that can be executed from a browser..." but I want to use other classes for API calls, etc... :P
 
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./vendor/autoload.php" colors="true">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory>./test/</directory>
        </testsuite>
    </testsuites>
</phpunit>
If my test directory is at root/test this should just run all the tests I have, shouldn't it?
It works if I specify a test path, but not without an argument.
./vendor/bin/phpunit test/some/path works but ./vendor/bin/phpunit doesn't run any tests.
 
indeed
possibly the phpunit.xml is not in the cwd when invoking that command?
 
#WTF
Tis. phpunit.xml is in the same directory where I'm running.
Oh. The filename of the test has to end in Test.
 
10:29 PM
I know how to do this exercise but I'm so nervous I'm going to misunderstand some of the requirements :B
You will be provided a sample file with [...]. We expect an html table outputting [...]. What does that mean?? Do I access the file directly via PHP, or use an HTML file upload form? Aghh
 
Gah. I've hit a testing roadblock. I don't know what to do now.
The tutorial I'm reading is suggesting using a service locator to create obejects to be tested.
How do you...you know...not do that?
 
maybe you can do the same bootstrap setup as normally, but with test instances?
 
@FélixGagnon-Grenier Then you have to write and maintain a bajillion mock objects, don't you?
And every object has to have an interface to ensure the mocks implement everything?
 
10:44 PM
In (my) practice, I generally only change the configuration of the PDO connection, and of some mailing and external API access services
Technically, classes don't need to know they're in tests or production. They process stuff, and we're testing expected outputs from expected inputs. (note: I am far from expert in the testing subject, there's much more to it)
 
So you inject the real dependencies of the object you're testing into your test objects?
 
Sure.
Actually, the DIC does it for me.
 
How do you ensure that the tests start at the bottom?
 
Come again?
 
How do you ensure that the real dependencies you're injecting into your test have been tested?
You want to test "from the bottom up". You feel?
 
10:48 PM
I don't understand. What "false" dependencies are there?
brb
 
@FélixGagnon-Grenier Say Foo depends on Bar. If you test Foo before you test Bar and Bar is incorrect, then you're boned. :D
Plus then how do you avoid things like actually making a DB query, or sending an HTTP request?
 
@Allenph I do the DB queries. In a test database.
 
downside of placing a query within a command regarding CQRS?
 
@FélixGagnon-Grenier Can't exactly have a test API.
 
@Allenph I don't understand that. If I test Foo, that depends on Bar, and Bar is incorrect, there is no way Foo is supposed to work correctly
 
11:00 PM
@FélixGagnon-Grenier The whole point is to be able to test the objects independent of each other. (At least that's what I thought.)
Otherwise...why not just run the code?
You'll get an exception (hopefully)
 
As for API, there is some conflicting opinion, but yes, generally I would test that it still has the structure I expect... But I don't really test google services that much'
 
@Wes We needith you.
 
@Allenph yeah, somewhat. But not independently test objects that are dependant on each other.
 
Also @tereško. Especially if you're already drunk.
@FélixGagnon-Grenier Sentence didn't make sense to me.
 
I'm all for decoupling classes, but that "ground up" concept doesn't seem to make sense to me. It is of no importance in which order I test stuff. Unless you have a single giant test function that tests all the cases on the same instances.
 
11:04 PM
groud?
 
@FélixGagnon-Grenier you test to find what's broken. if Foo's tests fail and the problem is really in Bar then those tests didn't help you.
 
^ Exactly.
 
@Allenph Avoid DB query by using a repository interface that can be mocked?
 
@Steel Then I have to maintain two objects.
 
@Allenph one of those objects doesn't really do anything though, and phpunit has tools to help phpunit.de/manual/current/en/test-doubles.html
 
11:11 PM
@PaulCrovella I had looked at just creating mocks.
It just seems like I could invalidate tests that way without knowing, but I guess that's kind of the point right?
 
11:22 PM
@PaulCrovella yes, indeed. But when you fix Bar, then either Foo's will work or they won't. otherwise why even have test on Foo?
 
@FélixGagnon-Grenier TO test the behavior of foo independently.
You want to throw an error in Bar is Bar is broken, the whole point is to not have to traverse the stack.
 
@FélixGagnon-Grenier you have to know the problem is in Bar before you can fix it. if your test report has a failures in a dozen places that means you're wading through a bunch of irrelevant crap to find what's really wrong
while the alternative is to use test doubles appropriately and have a test report that tells you exactly what broke.
 
11:41 PM
Any employers/interviewers out there, if you give a PHP assessment to someone that requires conversion and say "Three free APIs that can be used for currency conversion: (google's API, Yahoo's API, third API)", do you expect them to use one of those API's? I wrote a convert plugin for Jeeves (that still hasn't been merged :/) that goes straight to the ECB website to find rates, and does the conversion itself. I don't know if I should just use that code?
 
00:00 - 22:0022:00 - 00:00

« first day (2680 days earlier)      last day (2271 days later) »