Uh… because it won’t handle “localhost” properly.
There seems to be two possible reasons. Streams and Sockets.
I have no problems with PHP 5.3.0. It works.
PHP 5.3.3 BROKEN IMHO.
Uh… because it won’t handle “localhost” properly.
There seems to be two possible reasons. Streams and Sockets.
I have no problems with PHP 5.3.0. It works.
PHP 5.3.3 BROKEN IMHO.
I am freakin’ excited!
I got tired of switching between tabs and firebug when trying to figure out what the hell was going on with my ajax requests.
The worst is when I tried finding anything about my requests in Internet Explorer. Forget it!
So I wrote a jQuery Plug-in. You attach it to your page and it will monitor all your Ajax requests [1].
The running unit tests for the source.
The running unit tests validating with jQuery 1.4.2 Ajax tests with the plug in. [2]
Two feature that are becoming a must have for this plug in
1> Mocking Ajax request by specifying your Ajax settings like this: { /*other settings*/ mock: true }
2> What I’m going to call single-shot.
Presently the way I TDD a client, is I retrieve content using the normal Ajax call to get the presentation HTML.
Then I make another Ajax call in my normal code and store it into a string. At the start of each test I load this string into my: $(‘#contentContainer’).html(myPreloadedPresentationHTML);
Then remove it. So for all the unit tests I make a total of TWO Ajax calls. That’s one too many calls (latency can be up to 1~2 seconds OUCH!).
Since the monitor already controls the success callback of the original Ajax request why not replace it with my own.
First Ajax request success supplies the response data.
Hang onto it.
Any other calls to this request will get the stored response data.
I would welcome any comments.
Good or Bad!
…even requests.
Please help push against this software. I think it is a great tool and could be better with your help.
[1] Because jQuery 1.4.2 executes the complete callback twice during the request. If you want you can include my modified jQuery 1.4.2 library that fixes this use it. See here for bug tick #5383 .
[2] Two failing tests dealing with preserving the context. It is caused by XPC Cross Origin Wrapper. If anybody has a fix, post on stackoverflow.com.
Thanks from the ajaxMonitor Team.
function NewMessageBus() {
return {
when: function(name, fn) {
this.fire[name] = fn;
},
fire: {}
};
}
var msgBus = NewMessageBus();
var presenter = (function() {
msgBus.when('getContent', function() {
model.load(view.content);
});
}());
Note that the presenter is state-less.
var view = {
getContent: function() {
msgBus.fire.getContent();
},
content(htmlData) {
$('#contentContainer').html(htmlData);
}
}
var model = {
load: function(cb) {
$.ajax({
type: 'GET',
url: 'myContent.php',
dataType: 'json',
data: {/* some parameters */},
success: function(data) {
// some preprocessing of data
cb(data.html);
// some post processing of data
});
}
}
view.getContent();
That’s it pretty simple.
The view/model does not have any references to each other.
This presentation is not a condemnation of Drupal 6.X SimpleTest.
It is an idea that there are areas that can be improved.
Tank: We’re supposed to start with these operation programs first. That’s major boring shit. Let’s do something a little more fun. How about… combat training.
Neo : Ju jitsu? I’m gonna learn Ju jitsu.
[Tank winks and loads the program]
Neo : Holy shit!
Tank : Hey Mikey, I think he likes it. How about some more?
Neo : Hell, yes. Hell yeah.
Well I can tell you that I prefer comabt training…
I was cruising StackOverflow and came across this:
The funny part is the remark to the question.
when you deride people for not being able to unit test due to dependencies 😉
’nuff said
If you add a new test, be sure to clear caches.
This is done in (Administer -> Site Configuration -> Performance).
I’m using:
Things to get running:
Things to remember:
Future:
This is a very good question: