{ "log": { "version": "1.2", "creator": { "name": "WebInspector", "version": "537.36" }, "pages": [ { "startedDateTime": "2017-04-17T01:12:39.130Z", "id": "page_3", "title": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5", "pageTimings": { "onContentLoad": 62.69099982455373, "onLoad": 169.08699995838106 } } ], "entries": [ { "startedDateTime": "2017-04-17T01:12:39.130Z", "time": 4.252000013366342, "request": { "method": "GET", "url": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5", "httpVersion": "HTTP/1.1", "headers": [ { "name": "Pragma", "value": "no-cache" }, { "name": "DNT", "value": "1" }, { "name": "Accept-Encoding", "value": "gzip, deflate, sdch, br" }, { "name": "Host", "value": "127.0.0.1:4000" }, { "name": "Accept-Language", "value": "en-US,en;q=0.8" }, { "name": "Upgrade-Insecure-Requests", "value": "1" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" }, { "name": "Accept", "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" }, { "name": "Cache-Control", "value": "no-cache" }, { "name": "Referer", "value": "http://127.0.0.1:4000/blog" }, { "name": "Cookie", "value": "_ga=GA1.1.144569011.1487542273; _gat=1" }, { "name": "Connection", "value": "keep-alive" } ], "queryString": [], "cookies": [ { "name": "_ga", "value": "GA1.1.144569011.1487542273", "expires": null, "httpOnly": false, "secure": false }, { "name": "_gat", "value": "1", "expires": null, "httpOnly": false, "secure": false } ], "headersSize": 571, "bodySize": 0 }, "response": { "status": 200, "statusText": "OK", "httpVersion": "HTTP/1.1", "headers": [ { "name": "Date", "value": "Mon, 17 Apr 2017 01:12:39 GMT" }, { "name": "Last-Modified", "value": "Mon, 17 Apr 2017 01:11:00 GMT" }, { "name": "Server", "value": "WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)" }, { "name": "Etag", "value": "834951d-2177-58f41624" }, { "name": "Content-Type", "value": "text/html; charset=utf-8" }, { "name": "Cache-Control", "value": "private, max-age=0, proxy-revalidate, no-store, no-cache, must-revalidate" }, { "name": "Connection", "value": "Keep-Alive" }, { "name": "Content-Length", "value": "8567" } ], "cookies": [], "content": { "size": 8567, "mimeType": "text/html", "compression": -1, "text": "Fixing Laravel 5.4's Dependency on PHPUnit 5

Fixing Laravel 5.4's Dependency on PHPUnit 5

Normally, when I write unit tests, I don’t use Laravel’s facade and fakery methods. I do a lot of injection of services, but in one particular case, when working with the Queue system, I had to use the facade for faking the queue and asserting some jobs were pushed.

However, when I ran the following code in a unit test, I got an error that class PHPUnit_Framework_Assert was not found.

class QueueFakeTest extends AbstractTestCase \n{\n  public function testCanAssertPushed()\n  {\n    Queue::fake();\n    Queue::assertPushed('my-job');\n  }\n}\n

After looking into the actual code for assertPushed I see a dependency of the PHPUnit non-namespaced class. This is PHPUnit 4 land. You might remember, in PHPUnit 5, they namespaced their classes, but added aliases so that it’d still be backwards compatible. Well, this was removed in PHPUnit 6.

Time to look at my composer file…

composer.json

{\n  \"require\": {\n    \"laravel/framework\": \"5.4.*\",\n  },\n  \"require-dev\": {\n    \"phpunit/phpunit\": \"~6.0\",\n  }\n}\n

Obviously, I’ve snipped out portions of it. But yep, I was requiring PHPUnit 6, but in Laravel 5.4 (at least 5.4.16), the header in in QueueFake reveals the problem:

vendor/laravel/framework/...../Fakes/QueueFake.php

<?php\nnamespace Illuminate\\Support\\Testing\\Fakes;\n\nuse Illuminate\\Contracts\\Queue\\Queue;\nuse PHPUnit_Framework_Assert as PHPUnit;\n\nclass QueueFake implements Queue\n{\n// snip\n}\n

As you can see, it’s importing the class alias instead of the actual namespaced code (that was available in the recommended PHPUnit 5 that laravel suggested).

What’s the Fix?

Like many of us, I have my own bootstrap php file in the tests directory (it imports the main bootstrap file for laravel, and does a few other things.)

In order to fix this, I decided to add class aliases to this bootstrap file.

/**\n * Laravel has some testing helpers that are using the non-namespaced PHPUnit \n * classes, but these were removed in PHPUnit 6\n */\nclass_alias(\\PHPUnit\\Framework\\Assert::class,'PHPUnit_Framework_Assert');\n

Running this, my test now fails, but in a good way! (The job ‘my-job’ was never submitted.) This fixes this helper.

Now, I know that in PHPUnit 5 source code there probably is a bunch of aliases for each class, and the lazy way would be to just find that code and copy it into my project. However, I don’t want those aliases available. (I don’t want to accidentally use them myself either!) So, instead, I decided to search the Laravel framework for instances of PHPUnit_ which should give me a list of the rest of the times that Laravel might do this.

The updated list, as far as I can tell, is this:

class_alias(\\PHPUnit\\Framework\\Assert::class,'PHPUnit_Framework_Assert');\nclass_alias(\n  \\PHPUnit\\Framework\\ExpectationFailedException::class, \n  'PHPUnit_Framework_ExpectationFailedException'\n);\nclass_alias(\n  \\PHPUnit\\Framework\\Constraint\\LogicalNot::class, \n  'PHPUnit_Framework_Constraint_Not'\n);\nclass_alias(\n  \\PHPUnit\\Framework\\Constraint\\Constraint::class, \n  'PHPUnit_Framework_Constraint'\n);\n

Then, you should be able to continue using Laravel 5.4 with PHPUnit 6.

php, testing, phpunit, laravel

Return to All Posts

\n" }, "redirectURL": "", "headersSize": 354, "bodySize": 8568, "_transferSize": 8922 }, "cache": {}, "timings": { "blocked": 1.0519998613745, "dns": -1, "connect": -1, "send": 0.0690000597387499, "wait": 1.6419999301433599, "receive": 1.4890001621097317, "ssl": -1 }, "serverIPAddress": "127.0.0.1", "connection": "309906", "pageref": "page_3" }, { "startedDateTime": "2017-04-17T01:12:39.144Z", "time": 3.528999863192439, "request": { "method": "GET", "url": "http://127.0.0.1:4000/css/main.css", "httpVersion": "HTTP/1.1", "headers": [ { "name": "Pragma", "value": "no-cache" }, { "name": "DNT", "value": "1" }, { "name": "Accept-Encoding", "value": "gzip, deflate, sdch, br" }, { "name": "Host", "value": "127.0.0.1:4000" }, { "name": "Accept-Language", "value": "en-US,en;q=0.8" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" }, { "name": "Accept", "value": "text/css,*/*;q=0.1" }, { "name": "Referer", "value": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "Cookie", "value": "_ga=GA1.1.144569011.1487542273; _gat=1" }, { "name": "Connection", "value": "keep-alive" }, { "name": "Cache-Control", "value": "no-cache" } ], "queryString": [], "cookies": [ { "name": "_ga", "value": "GA1.1.144569011.1487542273", "expires": null, "httpOnly": false, "secure": false }, { "name": "_gat", "value": "1", "expires": null, "httpOnly": false, "secure": false } ], "headersSize": 493, "bodySize": 0 }, "response": { "status": 200, "statusText": "OK", "httpVersion": "HTTP/1.1", "headers": [ { "name": "Date", "value": "Mon, 17 Apr 2017 01:12:39 GMT" }, { "name": "Last-Modified", "value": "Mon, 17 Apr 2017 01:10:57 GMT" }, { "name": "Server", "value": "WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)" }, { "name": "Etag", "value": "51cf7b9-108a-58f41621" }, { "name": "Content-Type", "value": "text/css; charset=utf-8" }, { "name": "Cache-Control", "value": "private, max-age=0, proxy-revalidate, no-store, no-cache, must-revalidate" }, { "name": "Connection", "value": "Keep-Alive" }, { "name": "Content-Length", "value": "4234" } ], "cookies": [], "content": { "size": 4234, "mimeType": "text/css", "compression": -1, "text": "body{margin:0;color:#333;background:#272727;font-family:Palatino, \"Palatino Linotype\", \"Palatino LT STD\", \"Book Antiqua\", Georgia, serif;font-size:1.37rem;line-height:2rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body>header{background:#ffffff}body>header nav{width:80%;max-width:60rem;margin:auto;display:flex;justify-content:space-between;padding:3rem 0 0.5rem 0;border-bottom:0.15rem solid #eeeeee}body>header a{color:#333}body>footer{width:80%;max-width:60rem;margin:auto;padding:3rem 0 1rem 0;color:#454545;text-align:center}body>footer ul{display:flex;flex-wrap:wrap;list-style:none;justify-content:space-around;margin:0 0 2rem 0;padding:0}body>footer a,body>footer a:visited{color:#777777;text-decoration:none}body>footer p{font-size:0.8rem}main{padding:3rem 0;background:#ffffff}main>*{width:80%;max-width:60rem;margin:auto}a{color:#369;text-decoration:none}h3{font-size:1.9rem;line-height:2.6rem}abbr{border-bottom:0.01rem dotted #e0e0e0}blockquote{margin-left:0;padding-left:2rem;border-left:0.3rem solid #E2E2E2;background:#f9f9f9}.pull-right{float:right}.leader{padding:1rem 0 2rem 0;font-style:italic}.last-cta{text-align:center;font-weight:bold}#hero{line-height:2.4rem}#hero h1,#hero h3{display:inline}#hero h1{padding-right:0.6rem}#hero h1,#hero h3,#hero p{font-size:2rem}#hero p{margin-top:0}article{display:flex;flex-direction:column;margin-bottom:1.4rem}article header{order:1}article footer{order:2;font-size:0.8rem;padding:0 0.1rem;color:#666}article footer time{padding-right:1rem}article section{order:3}article h2{font-size:2rem;line-height:2.9rem;margin:0}article h2 a,article h2 a:visited{color:#369}article h2 a:hover{color:#59f}.read-more{font-size:1rem;color:#666;text-decoration:none}.entries article:after{content:'—';text-align:center;color:#e4e4e4;order:4}.old-post{background:#fff4a5;border:0.15rem solid #ffb710;padding:1rem 1.6rem;margin:3rem 0}.thumbnail{display:block;margin:1rem 0;text-align:center}.thumbnail img{-webkit-box-shadow:0 3px 6px rgba(0,0,0,0.25);-moz-box-shadow:0 3px 6px rgba(0,0,0,0.25);box-shadow:0 3px 6px rgba(0,0,0,0.25);padding:5px}.thumbnail.pull-right{margin-left:2rem}.inline img{max-width:40rem;max-height:20rem;margin:auto}table{width:100%;margin:1.5rem;border-collapse:collapse}th{background:#f4f4f4}td,th{border:1px solid #cecece;padding:0.5rem}.highlight{white-space:pre;overflow:auto;word-wrap:normal;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:20px;background:#343642;color:#C1C2C3}.highlight .hll{background-color:#ffc}.highlight .gd{color:#2e3436;background-color:#0e1416}.highlight .gr{color:#eeeeec;background-color:#c00}.highlight .gi{color:#babdb6;background-color:#1f2b2d}.highlight .go{color:#2c3032;background-color:#2c3032}.highlight .kt{color:#e3e7df}.highlight .ni{color:#888a85}.highlight .c,.highlight .cm,.highlight .c1,.highlight .cs{color:#8D9684}.highlight .err,.highlight .g,.highlight .l,.highlight .n,.highlight .x,.highlight .p,.highlight .ge,.highlight .gp,.highlight .gs,.highlight .gt,.highlight .ld,.highlight .s,.highlight .nc,.highlight .nd,.highlight .ne,.highlight .nl,.highlight .nn,.highlight .nx,.highlight .py,.highlight .ow,.highlight .w,.highlight .sb,.highlight .sc,.highlight .sd,.highlight .s2,.highlight .se,.highlight .sh,.highlight .si,.highlight .sx,.highlight .sr,.highlight .s1,.highlight .ss,.highlight .bp{color:#C1C2C3}.highlight .k,.highlight .kc,.highlight .kd,.highlight .kn,.highlight .kp,.highlight .kr,.highlight .nt{color:#729fcf}.highlight .cp,.highlight .gh,.highlight .gu,.highlight .na,.highlight .nf{color:#E9A94B}.highlight .m,.highlight .nb,.highlight .no,.highlight .mf,.highlight .mh,.highlight .mi,.highlight .mo,.highlight .il{color:#8ae234}.highlight .o{color:#989DAA}.highlight .nv,.highlight .vc,.highlight .vg,.highlight .vi{color:#fff}.highlight,.highlight>pre{margin:0;line-height:1.5rem}code.highlighter-rouge{background:#eaeaea;color:#343642;padding:0.3rem}#notfound_video{position:fixed;right:0;bottom:0;min-width:100%;min-height:100%;width:auto;height:auto;z-index:-100;background-size:cover}#not-found-link{display:block;text-align:center}#not-found-link a{color:#000000;background:rgba(255,255,255,0.4);display:inline-block}\n" }, "redirectURL": "", "headersSize": 353, "bodySize": 4235, "_transferSize": 4588 }, "cache": {}, "timings": { "blocked": 1.49099994450808, "dns": -1, "connect": -1, "send": 0.05399994552135001, "wait": 1.7040001694112998, "receive": 0.2799998037517093, "ssl": -1 }, "serverIPAddress": "127.0.0.1", "connection": "309906", "pageref": "page_3" }, { "startedDateTime": "2017-04-17T01:12:39.200Z", "time": 36.936999997124076, "request": { "method": "GET", "url": "https://www.google-analytics.com/analytics.js", "httpVersion": "unknown", "headers": [ { "name": "Referer", "value": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" } ], "queryString": [], "cookies": [], "headersSize": -1, "bodySize": 0 }, "response": { "status": 200, "statusText": "", "httpVersion": "unknown", "headers": [ { "name": "strict-transport-security", "value": "max-age=10886400; includeSubDomains; preload" }, { "name": "content-encoding", "value": "gzip" }, { "name": "x-content-type-options", "value": "nosniff" }, { "name": "last-modified", "value": "Mon, 03 Apr 2017 21:04:51 GMT" }, { "name": "server", "value": "Golfe2" }, { "name": "age", "value": "5034" }, { "name": "date", "value": "Sun, 16 Apr 2017 23:48:45 GMT" }, { "name": "vary", "value": "Accept-Encoding" }, { "name": "content-type", "value": "text/javascript" }, { "name": "status", "value": "200" }, { "name": "cache-control", "value": "public, max-age=7200" }, { "name": "timing-allow-origin", "value": "*" }, { "name": "alt-svc", "value": "quic=\":443\"; ma=2592000; v=\"37,36,35\"" }, { "name": "content-length", "value": "12163" }, { "name": "expires", "value": "Mon, 17 Apr 2017 01:48:45 GMT" } ], "cookies": [], "content": { "size": 29478, "mimeType": "text/javascript", "text": "(function(){var $c=function(a){this.w=a||[]};$c.prototype.set=function(a){this.w[a]=!0};$c.prototype.encode=function(){for(var a=[],b=0;b\\x3c/script>')):(c=M.createElement(\"script\"),\nc.type=\"text/javascript\",c.async=!0,c.src=a,d&&(c.onload=d),b&&(c.id=b),a=M.getElementsByTagName(\"script\")[0],a.parentNode.insertBefore(c,a)))},Ud=function(){return\"https:\"==M.location.protocol},E=function(a,b){return(a=a.match(\"(?:&|#|\\\\?)\"+K(b).replace(/([.*+?^=!:${}()|\\[\\]\\/\\\\])/g,\"\\\\$1\")+\"=([^&#]*)\"))&&2==a.length?a[1]:\"\"},xa=function(){var a=\"\"+M.location.hostname;return 0==a.indexOf(\"www.\")?a.substring(4):a},ya=function(a){var b=M.referrer;if(/^https?:\\/\\//i.test(b)){if(a)return b;a=\"//\"+M.location.hostname;\nvar c=b.indexOf(a);if(5==c||6==c)if(a=b.charAt(c+a.length),\"/\"==a||\"?\"==a||\"\"==a||\":\"==a)return;return b}},za=function(a,b){if(1==b.length&&null!=b[0]&&\"object\"===typeof b[0])return b[0];for(var c={},d=Math.min(a.length+1,b.length),e=0;e=b.length)wc(a,b,c);else if(8192>=b.length)x(a,b,c)||wd(a,b,c)||wc(a,b,c);else throw ge(\"len\",b.length),new Da(b.length);},wc=function(a,b,c){var d=ta(a+\"?\"+b);d.onload=d.onerror=function(){d.onload=null;d.onerror=null;c()}},wd=function(a,b,c){var d=O.XMLHttpRequest;if(!d)return!1;var e=new d;if(!(\"withCredentials\"in e))return!1;\ne.open(\"POST\",a,!0);e.withCredentials=!0;e.setRequestHeader(\"Content-Type\",\"text/plain\");e.onreadystatechange=function(){4==e.readyState&&(c(),e=null)};e.send(b);return!0},x=function(a,b,c){return O.navigator.sendBeacon?O.navigator.sendBeacon(a,b)?(c(),!0):!1:!1},ge=function(a,b,c){1<=100*Math.random()||G(\"?\")||(a=[\"t=error\",\"_e=\"+a,\"_v=j50\",\"sr=1\"],b&&a.push(\"_f=\"+b),c&&a.push(\"_m=\"+K(c.substring(0,100))),a.push(\"aip=1\"),a.push(\"z=\"+hd()),wc(oc()+\"/collect\",a.join(\"&\"),ua))};var h=function(a){var b=O.gaData=O.gaData||{};return b[a]=b[a]||{}};var Ha=function(){this.M=[]};Ha.prototype.add=function(a){this.M.push(a)};Ha.prototype.D=function(a){try{for(var b=0;b=100*R(a,Ka))throw\"abort\";}function Ma(a){if(G(P(a,Na)))throw\"abort\";}function Oa(){var a=M.location.protocol;if(\"http:\"!=a&&\"https:\"!=a)throw\"abort\";}\nfunction Pa(a){try{O.navigator.sendBeacon?J(42):O.XMLHttpRequest&&\"withCredentials\"in new O.XMLHttpRequest&&J(40)}catch(c){}a.set(ld,Td(a),!0);a.set(Ac,R(a,Ac)+1);var b=[];Qa.map(function(c,d){d.F&&(c=a.get(c),void 0!=c&&c!=d.defaultValue&&(\"boolean\"==typeof c&&(c*=1),b.push(d.F+\"=\"+K(\"\"+c))))});b.push(\"z=\"+Bd());a.set(Ra,b.join(\"&\"),!0)}\nfunction Sa(a){var b=P(a,gd)||oc()+\"/collect\",c=P(a,fa);!c&&a.get(Vd)&&(c=\"beacon\");if(c){var d=P(a,Ra),e=a.get(Ia),e=e||ua;\"image\"==c?wc(b,d,e):\"xhr\"==c&&wd(b,d,e)||\"beacon\"==c&&x(b,d,e)||ba(b,d,e)}else ba(b,P(a,Ra),a.get(Ia));b=a.get(Na);b=h(b);c=b.hitcount;b.hitcount=c?c+1:1;b=a.get(Na);delete h(b).pending_experiments;a.set(Ia,ua,!0)}\nfunction Hc(a){(O.gaData=O.gaData||{}).expId&&a.set(Nc,(O.gaData=O.gaData||{}).expId);(O.gaData=O.gaData||{}).expVar&&a.set(Oc,(O.gaData=O.gaData||{}).expVar);var b;var c=a.get(Na);if(c=h(c).pending_experiments){var d=[];for(b in c)c.hasOwnProperty(b)&&c[b]&&d.push(encodeURIComponent(b)+\".\"+encodeURIComponent(c[b]));b=d.join(\"!\")}else b=void 0;b&&a.set(m,b,!0)}function cd(){if(O.navigator&&\"preview\"==O.navigator.loadPurpose)throw\"abort\";}\nfunction yd(a){var b=O.gaDevIds;ka(b)&&0!=b.length&&a.set(\"&did\",b.join(\",\"),!0)}function vb(a){if(!a.get(Na))throw\"abort\";};var hd=function(){return Math.round(2147483647*Math.random())},Bd=function(){try{var a=new Uint32Array(1);O.crypto.getRandomValues(a);return a[0]&2147483647}catch(b){return hd()}};function Ta(a){var b=R(a,Ua);500<=b&&J(15);var c=P(a,Va);if(\"transaction\"!=c&&\"item\"!=c){var c=R(a,Wa),d=(new Date).getTime(),e=R(a,Xa);0==e&&a.set(Xa,d);e=Math.round(2*(d-e)/1E3);0=c)throw\"abort\";a.set(Wa,--c)}a.set(Ua,++b)};var Ya=function(){this.data=new ee},Qa=new ee,Za=[];Ya.prototype.get=function(a){var b=$a(a),c=this.data.get(a);b&&void 0==c&&(c=ea(b.defaultValue)?b.defaultValue():b.defaultValue);return b&&b.Z?b.Z(this,a,c):c};var P=function(a,b){a=a.get(b);return void 0==a?\"\":\"\"+a},R=function(a,b){a=a.get(b);return void 0==a||\"\"===a?0:1*a};Ya.prototype.set=function(a,b,c){if(a)if(\"object\"==typeof a)for(var d in a)a.hasOwnProperty(d)&&ab(this,d,a[d],c);else ab(this,a,b,c)};\nvar ab=function(a,b,c,d){if(void 0!=c)switch(b){case Na:wb.test(c)}var e=$a(b);e&&e.o?e.o(a,b,c,d):a.data.set(b,c,d)},bb=function(a,b,c,d,e){this.name=a;this.F=b;this.Z=d;this.o=e;this.defaultValue=c},$a=function(a){var b=Qa.get(a);if(!b)for(var c=0;c=b?!1:!0},gc=function(a){var b={};if(Ec(b)||Fc(b)){var c=b[Eb];void 0==c||Infinity==c||isNaN(c)||(0c)a[b]=void 0},Fd=function(a){return function(b){if(\"pageview\"==b.get(Va)&&!a.I){a.I=!0;var c=\naa(b);b=0b.length)){for(var c=[],\nd=0;d=a&&d.push({hash:ca[0],R:e[g],O:ca})}if(0!=d.length)return 1==d.length?d[0]:Zc(b,d)||Zc(c,d)||Zc(null,d)||d[0]}function Zc(a,b){var c;null==a?c=a=1:(c=La(a),a=La(D(a,\".\")?a.substring(1):\".\"+a));for(var d=0;d=ca[0]||0>=ca[1]?\"\":ca.join(\"x\");a.set(rb,c);a.set(tb,fc());a.set(ob,M.characterSet||M.charset);a.set(sb,b&&\"function\"===typeof b.javaEnabled&&b.javaEnabled()||!1);a.set(nb,(b&&(b.language||b.browserLanguage)||\"\").toLowerCase());if(d&&a.get(cc)&&(b=M.location.hash)){b=b.split(/[?&#]+/);d=[];for(c=0;carguments.length)){var b,c;\"string\"===typeof arguments[0]?(b=arguments[0],c=[].slice.call(arguments,1)):(b=arguments[0]&&arguments[0][Va],c=arguments);b&&(c=za(qc[b]||[],c),c[Va]=b,this.b.set(c,void 0,!0),this.filters.D(this.b),this.b.data.m={},Ed(this.ra,this.b)&&da(this.b.get(Na)))}};pc.prototype.ma=function(a,b){var c=this;u(a,c,b)||(v(a,function(){u(a,c,b)}),y(String(c.get(V)),a,void 0,b,!0))};var rc=function(a){if(\"prerender\"==M.visibilityState)return!1;a();return!0},z=function(a){if(!rc(a)){J(16);var b=!1,c=function(){if(!b&&rc(a)){b=!0;var d=c,e=M;e.removeEventListener?e.removeEventListener(\"visibilitychange\",d,!1):e.detachEvent&&e.detachEvent(\"onvisibilitychange\",d)}};L(M,\"visibilitychange\",c)}};var td=/^(?:(\\w+)\\.)?(?:(\\w+):)?(\\w+)$/,sc=function(a){if(ea(a[0]))this.u=a[0];else{var b=td.exec(a[0]);null!=b&&4==b.length&&(this.c=b[1]||\"t0\",this.K=b[2]||\"\",this.C=b[3],this.a=[].slice.call(a,1),this.K||(this.A=\"create\"==this.C,this.i=\"require\"==this.C,this.g=\"provide\"==this.C,this.ba=\"remove\"==this.C),this.i&&(3<=this.a.length?(this.X=this.a[1],this.W=this.a[2]):this.a[1]&&(qa(this.a[1])?this.X=this.a[1]:this.W=this.a[1])));b=a[1];a=a[2];if(!this.C)throw\"abort\";if(this.i&&(!qa(b)||\"\"==b))throw\"abort\";\nif(this.g&&(!qa(b)||\"\"==b||!ea(a)))throw\"abort\";if(ud(this.c)||ud(this.K))throw\"abort\";if(this.g&&\"t0\"!=this.c)throw\"abort\";}};function ud(a){return 0<=a.indexOf(\".\")||0<=a.indexOf(\":\")};var Yd,Zd,$d,A;Yd=new ee;$d=new ee;A=new ee;Zd={ec:45,ecommerce:46,linkid:47};\nvar u=function(a,b,c){b==N||b.get(V);var d=Yd.get(a);if(!ea(d))return!1;b.plugins_=b.plugins_||new ee;if(b.plugins_.get(a))return!0;b.plugins_.set(a,new d(b,c||{}));return!0},y=function(a,b,c,d,e){if(!ea(Yd.get(b))&&!$d.get(b)){Zd.hasOwnProperty(b)&&J(Zd[b]);if(p.test(b)){J(52);a=N.j(a);if(!a)return!0;c=d||{};d={id:b,B:c.dataLayer||\"dataLayer\",ia:!!a.get(\"anonymizeIp\"),na:e,G:!1};a.get(\">m\")==b&&(d.G=!0);var g=String(a.get(\"name\"));\"t0\"!=g&&(d.target=g);G(String(a.get(\"trackingId\")))||(d.ja=String(a.get(Q)),\nd.ka=Number(a.get(n)),c=c.palindrome?r:q,c=(c=M.cookie.replace(/^|(; +)/g,\";\").match(c))?c.sort().join(\"\").substring(1):void 0,d.la=c,d.qa=E(a.b.get(kb)||\"\",\"gclid\"));a=d.B;c=(new Date).getTime();O[a]=O[a]||[];c={\"gtm.start\":c};e||(c.event=\"gtm.js\");O[a].push(c);c=t(d)}!c&&Zd.hasOwnProperty(b)?(J(39),c=b+\".js\"):J(43);c&&(c&&0<=c.indexOf(\"/\")||(c=(Ba||Ud()?\"https:\":\"http:\")+\"//www.google-analytics.com/plugins/ua/\"+c),d=ae(c),a=d.protocol,c=M.location.protocol,(\"https:\"==a||a==c||(\"http:\"!=a?0:\"http:\"==\nc))&&B(d)&&(wa(d.url,void 0,e),$d.set(b,!0)))}},v=function(a,b){var c=A.get(a)||[];c.push(b);A.set(a,c)},C=function(a,b){Yd.set(a,b);b=A.get(a)||[];for(var c=0;ca.split(\"/\")[0].indexOf(\":\")&&(a=ca+e[2].substring(0,\ne[2].lastIndexOf(\"/\"))+\"/\"+a);c.href=a;d=b(c);return{protocol:(c.protocol||\"\").toLowerCase(),host:d[0],port:d[1],path:d[2],query:c.search||\"\",url:a||\"\"}};var Z={ga:function(){Z.f=[]}};Z.ga();Z.D=function(a){var b=Z.J.apply(Z,arguments),b=Z.f.concat(b);for(Z.f=[];0c;c++){var d=b[c].src;if(d&&0==d.indexOf(\"https://www.google-analytics.com/analytics\")){J(33);\nb=!0;break a}}b=!1}b&&(Ba=!0)}Ud()||Ba||!Ed(new Od(1E4))||(J(36),Ba=!0);(O.gaplugins=O.gaplugins||{}).Linker=Dc;b=Dc.prototype;C(\"linker\",Dc);X(\"decorate\",b,b.ca,20);X(\"autoLink\",b,b.S,25);C(\"displayfeatures\",fd);C(\"adfeatures\",fd);a=a&&a.q;ka(a)?Z.D.apply(N,a):J(50)}};N.da=function(){for(var a=N.getAll(),b=0;b>21:b;return b};})(window);\n" }, "redirectURL": "", "headersSize": -1, "bodySize": -1, "_transferSize": 12191 }, "cache": {}, "timings": { "blocked": 1.73900020308793, "dns": -1, "connect": -1, "send": 0.0769998878240501, "wait": 32.71699999459092, "receive": 2.4039999116211774, "ssl": -1 }, "serverIPAddress": "216.58.217.46", "pageref": "page_3" }, { "startedDateTime": "2017-04-17T01:12:39.175Z", "time": 25.268000084906816, "request": { "method": "GET", "url": "http://www.google-analytics.com/analytics.js", "httpVersion": "unknown", "headers": [ { "name": "Referer", "value": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" } ], "queryString": [], "cookies": [], "headersSize": -1, "bodySize": 0 }, "response": { "status": 307, "statusText": "Internal Redirect", "httpVersion": "unknown", "headers": [ { "name": "Location", "value": "https://www.google-analytics.com/analytics.js" }, { "name": "Non-Authoritative-Reason", "value": "HSTS" } ], "cookies": [], "content": { "size": 0, "mimeType": "x-unknown" }, "redirectURL": "https://www.google-analytics.com/analytics.js", "headersSize": -1, "bodySize": -1, "_transferSize": 0 }, "cache": {}, "timings": { "blocked": 3.69700021110475, "dns": -1, "connect": -1, "send": 0, "wait": 0, "receive": 21.570999873802066, "ssl": -1 }, "serverIPAddress": "", "pageref": "page_3" }, { "startedDateTime": "2017-04-17T01:12:39.263Z", "time": 34.93400011211634, "request": { "method": "GET", "url": "https://www.google-analytics.com/collect?v=1&_v=j50&a=1365099937&t=pageview&_s=1&dl=http%3A%2F%2F127.0.0.1%2F2017%2Ffixing-laravel-5.4-dependency-on-phpunit-5&ul=en-us&de=UTF-8&dt=Fixing%20Laravel%205.4%27s%20Dependency%20on%20PHPUnit%205&sd=24-bit&sr=1440x900&vp=1410x712&je=0&fl=25.0%20r0&_u=AACAAEABI~&jid=&gjid=&cid=144569011.1487542273&tid=UA-2186364-4&z=1753849733", "httpVersion": "unknown", "headers": [ { "name": "Referer", "value": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" } ], "queryString": [ { "name": "v", "value": "1" }, { "name": "_v", "value": "j50" }, { "name": "a", "value": "1365099937" }, { "name": "t", "value": "pageview" }, { "name": "_s", "value": "1" }, { "name": "dl", "value": "http%3A%2F%2F127.0.0.1%2F2017%2Ffixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "ul", "value": "en-us" }, { "name": "de", "value": "UTF-8" }, { "name": "dt", "value": "Fixing%20Laravel%205.4%27s%20Dependency%20on%20PHPUnit%205" }, { "name": "sd", "value": "24-bit" }, { "name": "sr", "value": "1440x900" }, { "name": "vp", "value": "1410x712" }, { "name": "je", "value": "0" }, { "name": "fl", "value": "25.0%20r0" }, { "name": "_u", "value": "AACAAEABI~" }, { "name": "jid", "value": "" }, { "name": "gjid", "value": "" }, { "name": "cid", "value": "144569011.1487542273" }, { "name": "tid", "value": "UA-2186364-4" }, { "name": "z", "value": "1753849733" } ], "cookies": [], "headersSize": -1, "bodySize": 0 }, "response": { "status": 200, "statusText": "", "httpVersion": "unknown", "headers": [ { "name": "pragma", "value": "no-cache" }, { "name": "date", "value": "Thu, 13 Apr 2017 19:43:52 GMT" }, { "name": "x-content-type-options", "value": "nosniff" }, { "name": "last-modified", "value": "Sun, 17 May 1998 03:00:00 GMT" }, { "name": "server", "value": "Golfe2" }, { "name": "age", "value": "278927" }, { "name": "status", "value": "200" }, { "name": "content-type", "value": "image/gif" }, { "name": "access-control-allow-origin", "value": "*" }, { "name": "cache-control", "value": "no-cache, no-store, must-revalidate" }, { "name": "alt-svc", "value": "quic=\":443\"; ma=2592000; v=\"37,36,35\"" }, { "name": "content-length", "value": "35" }, { "name": "expires", "value": "Mon, 01 Jan 1990 00:00:00 GMT" } ], "cookies": [], "content": { "size": 35, "mimeType": "image/gif", "text": "R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs=", "encoding": "base64" }, "redirectURL": "", "headersSize": -1, "bodySize": -1, "_transferSize": 109 }, "cache": {}, "timings": { "blocked": 2.71200016140938, "dns": -1, "connect": -1, "send": 0.08199992589652005, "wait": 31.751999864354698, "receive": 0.38800016045573926, "ssl": -1 }, "serverIPAddress": "216.58.217.46", "pageref": "page_3" }, { "startedDateTime": "2017-04-17T01:12:39.261Z", "time": 1.7419999931007624, "request": { "method": "GET", "url": "http://www.google-analytics.com/collect?v=1&_v=j50&a=1365099937&t=pageview&_s=1&dl=http%3A%2F%2F127.0.0.1%2F2017%2Ffixing-laravel-5.4-dependency-on-phpunit-5&ul=en-us&de=UTF-8&dt=Fixing%20Laravel%205.4%27s%20Dependency%20on%20PHPUnit%205&sd=24-bit&sr=1440x900&vp=1410x712&je=0&fl=25.0%20r0&_u=AACAAEABI~&jid=&gjid=&cid=144569011.1487542273&tid=UA-2186364-4&z=1753849733", "httpVersion": "unknown", "headers": [ { "name": "Referer", "value": "http://127.0.0.1:4000/2017/fixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "User-Agent", "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" } ], "queryString": [ { "name": "v", "value": "1" }, { "name": "_v", "value": "j50" }, { "name": "a", "value": "1365099937" }, { "name": "t", "value": "pageview" }, { "name": "_s", "value": "1" }, { "name": "dl", "value": "http%3A%2F%2F127.0.0.1%2F2017%2Ffixing-laravel-5.4-dependency-on-phpunit-5" }, { "name": "ul", "value": "en-us" }, { "name": "de", "value": "UTF-8" }, { "name": "dt", "value": "Fixing%20Laravel%205.4%27s%20Dependency%20on%20PHPUnit%205" }, { "name": "sd", "value": "24-bit" }, { "name": "sr", "value": "1440x900" }, { "name": "vp", "value": "1410x712" }, { "name": "je", "value": "0" }, { "name": "fl", "value": "25.0%20r0" }, { "name": "_u", "value": "AACAAEABI~" }, { "name": "jid", "value": "" }, { "name": "gjid", "value": "" }, { "name": "cid", "value": "144569011.1487542273" }, { "name": "tid", "value": "UA-2186364-4" }, { "name": "z", "value": "1753849733" } ], "cookies": [], "headersSize": -1, "bodySize": 0 }, "response": { "status": 307, "statusText": "Internal Redirect", "httpVersion": "unknown", "headers": [ { "name": "Location", "value": "https://www.google-analytics.com/collect?v=1&_v=j50&a=1365099937&t=pageview&_s=1&dl=http%3A%2F%2F127.0.0.1%2F2017%2Ffixing-laravel-5.4-dependency-on-phpunit-5&ul=en-us&de=UTF-8&dt=Fixing%20Laravel%205.4%27s%20Dependency%20on%20PHPUnit%205&sd=24-bit&sr=1440x900&vp=1410x712&je=0&fl=25.0%20r0&_u=AACAAEABI~&jid=&gjid=&cid=144569011.1487542273&tid=UA-2186364-4&z=1753849733" }, { "name": "Non-Authoritative-Reason", "value": "HSTS" } ], "cookies": [], "content": { "size": 0, "mimeType": "x-unknown" }, "redirectURL": "https://www.google-analytics.com/collect?v=1&_v=j50&a=1365099937&t=pageview&_s=1&dl=http%3A%2F%2F127.0.0.1%2F2017%2Ffixing-laravel-5.4-dependency-on-phpunit-5&ul=en-us&de=UTF-8&dt=Fixing%20Laravel%205.4%27s%20Dependency%20on%20PHPUnit%205&sd=24-bit&sr=1440x900&vp=1410x712&je=0&fl=25.0%20r0&_u=AACAAEABI~&jid=&gjid=&cid=144569011.1487542273&tid=UA-2186364-4&z=1753849733", "headersSize": -1, "bodySize": -1, "_transferSize": 0 }, "cache": {}, "timings": { "blocked": 1.45099987275898, "dns": -1, "connect": -1, "send": 0, "wait": 0, "receive": 0.29100012034178246, "ssl": -1 }, "serverIPAddress": "", "pageref": "page_3" } ] } }