Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'wpc-mocha'

  • Loading branch information...
commit 5e0a2209bcc832310e33e966e570bbbc40a2328f 2 parents 212753f + 85bf816
Barnaby Walters barnabywalters authored
12 mocha-tests/microformat-php-mf2-helper.js
View
@@ -0,0 +1,12 @@
+var helper = {};
+helper.parseHTML = function(htmlFragment,baseUrl){
+ var request = new XMLHttpRequest();
+ var ran = Math.floor(Math.random()*9999999)
+ request.open('GET', 'http://waterpigs.co.uk/php-mf2/api/?html=' + encodeURIComponent(htmlFragment) + '&baseurl=' + encodeURIComponent(baseUrl) + '&ran=' + ran, false);
+ request.send();
+ if (request.status === 200) {
+ return JSON.parse(request.responseText);
+ }else{
+ return {};
+ }
+}
32 mocha-tests/microformat-php-mf2-v1.html
View
@@ -0,0 +1,32 @@
+<html>
+ <head>
+ <title>php-mf2 test suite</title>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+
+ <link rel="stylesheet" href="framework/mocha.css" />
+ <script src="framework/mocha.js"></script>
+ <script src="framework/chai.js"></script>
+ <script src="microformat-php-mf2-helper.js"></script>
+
+ <script>mocha.setup('bdd')</script>
+ <script src="h-adr-test.js"></script>
+ <script src="h-card-test.js"></script>
+ <script src="h-entry-test.js"></script>
+ <script src="h-event-test.js"></script>
+ <script src="h-geo-test.js"></script>
+ <script src="h-org-test.js"></script>
+ <script src="h-resume-test.js"></script>
+
+ <script>
+ onload = function(){
+ mocha.run();
+ };
+ </script>
+
+ </head>
+ <body>
+ <h3>php-mf2 - microformats 2 test</h3>
+ <div id="mocha"></div>
+ </body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.