Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:48:45+00:00 2026-05-31T05:48:45+00:00

I’ve been trying to parse the phpunit json log using jquery however it returns

  • 0

I’ve been trying to parse the phpunit json log using jquery however it returns me error.

I used the following code to parse

 <html>
    <head>
     <title>PHPUnit Report</title>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <script src="./jquery-1.6.2.min.js"></script>
  </head>
  <body>
     <script type="text/javascript">
        var json = $.getJSON('logfile.json', function(data){
            alert(data);
        }).success(function() { alert("second success"); })
        .error(function() { alert("error"); });
     </script>
   </body>
 </html>

That’s the json log file

 {"event":"suiteStart","suite":"","tests":22}{"event":"suiteStart","suite":"Application_Model_CarrinhoTest","tests":4}{"event":"testStart","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testCriacaoObjeto"}{"event":"test","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testCriacaoObjeto","status":"pass","time":0.013954162597656,"trace":[],"message":""}{"event":"testStart","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testAdicionarProduto"}{"event":"test","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testAdicionarProduto","status":"pass","time":0.015092134475708,"trace":[],"message":""}{"event":"testStart","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testRemoverProduto"}{"event":"test","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testRemoverProduto","status":"pass","time":0.0048158168792725,"trace":[],"message":""}{"event":"testStart","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testLimparCarrinho"}{"event":"test","suite":"Application_Model_CarrinhoTest","test":"Application_Model_CarrinhoTest::testLimparCarrinho","status":"pass","time":0.0047218799591064,"trace":[],"message":""}{"event":"suiteStart","suite":"Application_Model_ProdutoTest","tests":3}{"event":"testStart","suite":"Application_Model_ProdutoTest","test":"Application_Model_ProdutoTest::testaCriacaoProduto"}{"event":"test","suite":"Application_Model_ProdutoTest","test":"Application_Model_ProdutoTest::testaCriacaoProduto","status":"pass","time":0.0066261291503906,"trace":[],"message":""}{"event":"testStart","suite":"Application_Model_ProdutoTest","test":"Application_Model_ProdutoTest::testaErroCriacao"}{"event":"test","suite":"Application_Model_ProdutoTest","test":"Application_Model_ProdutoTest::testaErroCriacao","status":"pass","time":0.0081219673156738,"trace":[],"message":""}{"event":"testStart","suite":"Application_Model_ProdutoTest","test":"Application_Model_ProdutoTest::testaCadastroProduto"}{"event":"test","suite":"Application_Model_ProdutoTest","test":"Application_Model_ProdutoTest::testaCadastroProduto","status":"pass","time":0.086114883422852,"trace":[],"message":""}{"event":"suiteStart","suite":"Default_CarrinhoControllerTest","tests":4}{"event":"testStart","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testIndexAction"}{"event":"test","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testIndexAction","status":"fail","time":0.18276596069336,"trace":[],"message":"Failed asserting node denoted by div#view-content p CONTAINS content \"View script for controller <b>Carrinho<\/b> and script\/action name <b>index<\/b>\""}{"event":"testStart","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testAdicionarProdutoAction"}{"event":"test","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testAdicionarProdutoAction","status":"pass","time":0.038674831390381,"trace":[],"message":""}{"event":"testStart","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testRemoverProdutoAction"}{"event":"test","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testRemoverProdutoAction","status":"pass","time":0.039582967758179,"trace":[],"message":""}{"event":"testStart","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testAlterarQuantidadeProdutoAction"}{"event":"test","suite":"Default_CarrinhoControllerTest","test":"Default_CarrinhoControllerTest::testAlterarQuantidadeProdutoAction","status":"pass","time":0.038434982299805,"trace":[],"message":""}{"event":"suiteStart","suite":"Default_CategoriaControllerTest","tests":2}{"event":"testStart","suite":"Default_CategoriaControllerTest","test":"Default_CategoriaControllerTest::testIndexAction"}{"event":"test","suite":"Default_CategoriaControllerTest","test":"Default_CategoriaControllerTest::testIndexAction","status":"fail","time":0.043931007385254,"trace":[],"message":"Failed asserting node denoted by div#view-content p CONTAINS content \"View script for controller <b>Categoria<\/b> and script\/action name <b>index<\/b>\""}{"event":"testStart","suite":"Default_CategoriaControllerTest","test":"Default_CategoriaControllerTest::testDetalheAction"}{"event":"test","suite":"Default_CategoriaControllerTest","test":"Default_CategoriaControllerTest::testDetalheAction","status":"pass","time":0.040285110473633,"trace":[],"message":""}{"event":"suiteStart","suite":"Default_IndexControllerTest","tests":1}{"event":"testStart","suite":"Default_IndexControllerTest","test":"Default_IndexControllerTest::testIndexAction"}{"event":"test","suite":"Default_IndexControllerTest","test":"Default_IndexControllerTest::testIndexAction","status":"fail","time":0.045408964157104,"trace":[],"message":"Failed asserting node denoted by div#welcome h3 CONTAINS content \"This is your project's main page\""}{"event":"suiteStart","suite":"Default_ProdutoControllerTest","tests":2}{"event":"testStart","suite":"Default_ProdutoControllerTest","test":"Default_ProdutoControllerTest::testIndexAction"}{"event":"test","suite":"Default_ProdutoControllerTest","test":"Default_ProdutoControllerTest::testIndexAction","status":"fail","time":0.04747200012207,"trace":[],"message":"Failed asserting last controller used <\"error\"> was \"Produto\""}{"event":"testStart","suite":"Default_ProdutoControllerTest","test":"Default_ProdutoControllerTest::testDetalheAction"}{"event":"test","suite":"Default_ProdutoControllerTest","test":"Default_ProdutoControllerTest::testDetalheAction","status":"fail","time":0.042054891586304,"trace":[],"message":"Failed asserting last controller used <\"error\"> was \"Produto\""}{"event":"suiteStart","suite":"Default_ProdutosControllerTest","tests":3}{"event":"testStart","suite":"Default_ProdutosControllerTest","test":"Default_ProdutosControllerTest::testIndexAction"}{"event":"test","suite":"Default_ProdutosControllerTest","test":"Default_ProdutosControllerTest::testIndexAction","status":"pass","time":0.046010971069336,"trace":[],"message":""}{"event":"testStart","suite":"Default_ProdutosControllerTest","test":"Default_ProdutosControllerTest::testBuscarAction"}{"event":"test","suite":"Default_ProdutosControllerTest","test":"Default_ProdutosControllerTest::testBuscarAction","status":"pass","time":0.043781995773315,"trace":[],"message":""}{"event":"testStart","suite":"Default_ProdutosControllerTest","test":"Default_ProdutosControllerTest::testDetalheAction"}{"event":"test","suite":"Default_ProdutosControllerTest","test":"Default_ProdutosControllerTest::testDetalheAction","status":"pass","time":0.04433798789978,"trace":[],"message":""}{"event":"suiteStart","suite":"Default_UsuarioControllerTest","tests":3}{"event":"testStart","suite":"Default_UsuarioControllerTest","test":"Default_UsuarioControllerTest::testIndexAction"}{"event":"test","suite":"Default_UsuarioControllerTest","test":"Default_UsuarioControllerTest::testIndexAction","status":"pass","time":0.048629999160767,"trace":[],"message":""}{"event":"testStart","suite":"Default_UsuarioControllerTest","test":"Default_UsuarioControllerTest::testLogarAction"}{"event":"test","suite":"Default_UsuarioControllerTest","test":"Default_UsuarioControllerTest::testLogarAction","status":"pass","time":0.046178817749023,"trace":[],"message":""}{"event":"testStart","suite":"Default_UsuarioControllerTest","test":"Default_UsuarioControllerTest::testSairAction"}{"event":"test","suite":"Default_UsuarioControllerTest","test":"Default_UsuarioControllerTest::testSairAction","status":"pass","time":0.04793381690979,"trace":[],"message":""}

What’s wrong? How could I parse it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:48:46+00:00Added an answer on May 31, 2026 at 5:48 am

    I think your JSON is as it should be, phpunit outputs the JSON as an event occurs…each of these events can easily be parsed but doing them all as one will throw errors.

    I too would prefer to have a format that can be parsed straight away in JS or using php’s json_decode but looks like it won’t happen for now…

    https://github.com/sebastianbergmann/phpunit/issues/142

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.