<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Snippets/untitled.tmSnippet</filename>
    </added>
    <added>
      <filename>Support/phpunit.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,11 +3,13 @@
 &lt;plist version=&quot;1.0&quot;&gt;
 &lt;dict&gt;
 	&lt;key&gt;content&lt;/key&gt;
-	&lt;string&gt;public function setUp() {
+	&lt;string&gt;public function setUp() 
+{
 	$1
 }
 
-${2:public function tearDown() {
+${2:public function tearDown() 
+{
 	$3
 \}}
 </diff>
      <filename>Snippets/fixture.tmSnippet</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,8 @@
 	&lt;string&gt;/**
  * @expectedException ${1:ExceptionClassName}
 */
-public function test${2:TestName}() {
+public function test${2:TestName}() 
+{
     $0
 }&lt;/string&gt;
 	&lt;key&gt;name&lt;/key&gt;</diff>
      <filename>Snippets/test (expected exception).tmSnippet</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,8 @@
 	&lt;key&gt;content&lt;/key&gt;
 	&lt;string&gt;require_once 'PHPUnit/Framework.php';
 
-class ${1:ClassName}Test extends PHPUnit_Framework_TestCase {
+class ${1:ClassName}Test extends PHPUnit_Framework_TestCase 
+{
 	$0
 }&lt;/string&gt;
 	&lt;key&gt;name&lt;/key&gt;</diff>
      <filename>Snippets/testcase.tmSnippet</filename>
    </modified>
    <modified>
      <diff>@@ -4,56 +4,56 @@
     &lt;head&gt;
         &lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
         &lt;title&gt;
-            PHPUnit Results: &lt;%= title %&gt;
+            PHPUnit Results
         &lt;/title&gt;
         &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
             /* yui - reset */
             html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
             
             
-            #head {
+            .head {
                 padding: 1em;
                 background: #000;
                 color: #FFF;
             }
             
-            #head h1 .filename {
+            .head h1 .filename {
                 font-weight: bold;
             }
             
-            #summary {
+            .summary {
                 font-size: .9em;
                 float: right;
             }
             
-            #summary li {
+            .summary li {
                 display: inline;
                 padding: 0 .3em;
             }
             
-            #body {
+            .body {
                 padding: 1em;
             }
             
-            #results .time {
+            .results .time {
                 float: right;
             }
             
-            #results li {
+            .results li {
                 padding: 4px;
                 margin: 0 0 4px 0;
                 font-size: .9em;
             }
             
-            #results li h3 {
+            .results li h3 {
                 font-weight: bold;
             }
             
-            #results li h3 &gt; span {
+            .results li h3 &gt; span {
                 font-weight: normal;
             }
             
-            #results .message {
+            .results .message {
                 padding: 1em;
                 margin: 4px 0 0 0;
                 background: #333;
@@ -63,50 +63,81 @@
                 font-family: monospace;
             }
             
-            #results .message a:link,
-            #results .message a:visited,
-            #results .message a:active {
+            .results .message a:link,
+            .results .message a:visited,
+            .results .message a:active {
                 color: #FF0;
                 font-family: Arial, &quot;MS Trebuchet&quot;, sans-serif;
             }
             
             .total { background: #999; color: #FFF; }
             
-            #head.pass, .pass { background: #9f6; color: #090; }
-            #head.fail, .fail { background: #C00; color: #FFF; }
-            #head.skipped, .skipped { background: #CCC; color: #999; }
-            #head.incomplete, .incomplete { background: #FC0; color: #960; }
+            .head.pass { background: #090; color: #FFF; }
+            li.pass { background: #9f6; color: #090; border-left: 1em solid #090; }
+            .head.fail, li.fail { background: #C00; color: #FFF; }
+            
+            #parent {
+                padding: 2em;
+            }
+            
+            #parent .body {
+                padding: 0;
+            }
+            
+            #parent .head {
+                padding: 4px;
+                margin: 0 0 4px 0;
+            }
         &lt;/style&gt;
     &lt;/head&gt;
     &lt;body&gt;
-        &lt;div id=&quot;head&quot; class=&quot;&lt;%= overall_status %&gt;&quot;&gt;
-            &lt;div id=&quot;summary&quot;&gt;
+        &lt;% if results[:parent] %&gt;
+        &lt;div class=&quot;head &lt;%= results[:parent][:status] %&gt;&quot;&gt;
+            &lt;div class=&quot;summary&quot;&gt;
+                &lt;ul&gt;
+                    &lt;% if results[:parent][:counts][:fail] &gt; 0 %&gt;&lt;li&gt;&lt;%= results[:parent][:counts][:fail] %&gt; Fail&lt;/li&gt;&lt;% end %&gt;
+                    &lt;% if results[:parent][:counts][:pass] &gt; 0 %&gt;&lt;li&gt;&lt;%= results[:parent][:counts][:pass] %&gt; Pass&lt;/li&gt;&lt;% end %&gt;
+                    &lt;% if results[:parent][:counts][:assertions] &gt; 0 %&gt;&lt;li&gt;&lt;%= results[:parent][:counts][:assertions] %&gt; Assertions&lt;/li&gt;&lt;% end %&gt;
+                    &lt;li&gt;Total time: &lt;%= results[:parent][:total_time] %&gt; sec&lt;/li&gt;
+                &lt;/ul&gt;
+            &lt;/div&gt;
+            &lt;h1 class=&quot;phpunit_results&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;%= results[:parent][:name] %&gt;&lt;/span&gt;&lt;/h1&gt;
+        &lt;/div&gt;
+        &lt;div id=&quot;parent&quot;&gt;
+        &lt;% end %&gt;
+        &lt;% for testsuite in results[:suites] %&gt;
+        &lt;div class=&quot;head &lt;%= testsuite[:status] %&gt;&quot;&gt;
+            &lt;div class=&quot;summary&quot;&gt;
                 &lt;ul&gt;
-                    &lt;% if counts[:fail] &gt; 0 %&gt;&lt;li&gt;&lt;%= counts[:fail] %&gt; Fail&lt;/li&gt;&lt;% end %&gt;
-                    &lt;% if counts[:pass] &gt; 0 %&gt;&lt;li&gt;&lt;%= counts[:pass] %&gt; Pass&lt;/li&gt;&lt;% end %&gt;
-                    &lt;% if counts[:assertions] &gt; 0 %&gt;&lt;li&gt;&lt;%= counts[:assertions] %&gt; Assertions&lt;/li&gt;&lt;% end %&gt;
+                    &lt;% if testsuite[:counts][:fail] &gt; 0 %&gt;&lt;li&gt;&lt;%= testsuite[:counts][:fail] %&gt; Fail&lt;/li&gt;&lt;% end %&gt;
+                    &lt;% if testsuite[:counts][:pass] &gt; 0 %&gt;&lt;li&gt;&lt;%= testsuite[:counts][:pass] %&gt; Pass&lt;/li&gt;&lt;% end %&gt;
+                    &lt;% if testsuite[:counts][:assertions] &gt; 0 %&gt;&lt;li&gt;&lt;%= testsuite[:counts][:assertions] %&gt; Assertions&lt;/li&gt;&lt;% end %&gt;
                 &lt;/ul&gt;
             &lt;/div&gt;
-            &lt;h1 id=&quot;phpunit_results&quot;&gt;PHPUnit Results: &lt;span class=&quot;filename&quot;&gt;&lt;%= title %&gt;&lt;/span&gt;&lt;/h1&gt;
+            &lt;h1 class=&quot;phpunit_results&quot;&gt;&lt;span class=&quot;filename&quot;&gt;&lt;%= testsuite[:name] %&gt;&lt;/span&gt;&lt;/h1&gt;
         &lt;/div&gt;
-        &lt;div id=&quot;body&quot;&gt;
-            &lt;div id=&quot;results&quot;&gt;
+        &lt;div class=&quot;body&quot;&gt;
+            &lt;div class=&quot;results&quot;&gt;
                 &lt;ul&gt;
-                    &lt;% for r in test_results do %&gt;
-                    &lt;li class=&quot;&lt;%= r['status']%&gt;&quot;&gt;
-                        &lt;span class=&quot;time&quot;&gt;&lt;%= &quot;%01.8f&quot; % r[&quot;time&quot;] %&gt; sec&lt;/span&gt;
-                        &lt;h3&gt;&lt;span&gt;&lt;%= r[&quot;status&quot;].capitalize %&gt;&lt;/span&gt;: &lt;%= r[&quot;test&quot;].gsub(/_/,&quot; &quot;).gsub(/\([^\)]+\)/,'') %&gt;&lt;/h3&gt;
-                        &lt;% if r[&quot;status&quot;] == 'fail' %&gt;
-&lt;div class=&quot;message&quot;&gt;&lt;%= r['message'] %&gt;&lt;/div&gt;
+                    &lt;% for r in testsuite[:cases] do %&gt;
+                    &lt;li class=&quot;&lt;%= r[:status]%&gt;&quot;&gt;
+                        &lt;span class=&quot;time&quot;&gt;&lt;%= &quot;%01.8f&quot; % r[:time] %&gt; sec&lt;/span&gt;
+                        &lt;h3&gt;&lt;%= r[:test].gsub(/_/,&quot; &quot;).gsub(/\([^\)]+\)/,'') %&gt;&lt;/h3&gt;
+                        &lt;% if r[:status] == 'fail' %&gt;
+&lt;div class=&quot;message&quot;&gt;&lt;%= r[:message] %&gt;&lt;/div&gt;
                         &lt;% end %&gt;
                     &lt;/li&gt;
                     &lt;% end %&gt;
                     &lt;li class=&quot;total&quot;&gt;
-                        &lt;span class=&quot;time&quot;&gt;&lt;%= &quot;%01.8f&quot; % total_time %&gt; sec&lt;/span&gt;
+                        &lt;span class=&quot;time&quot;&gt;&lt;%= &quot;%01.8f&quot; % testsuite[:total_time] %&gt; sec&lt;/span&gt;
                         &lt;h3&gt;Total time:&lt;/h3&gt;
                     &lt;/li&gt;
                 &lt;/ul&gt;
             &lt;/div&gt;
         &lt;/div&gt;
+        &lt;% end %&gt;
+        &lt;% if results[:parent] %&gt;
+        &lt;/div&gt;
+        &lt;% end %&gt;
     &lt;/body&gt;
-&lt;/html&gt;
+&lt;/html&gt;
\ No newline at end of file</diff>
      <filename>Support/results.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -3,40 +3,13 @@ require 'rubygems'
 require 'xml'
 require 'erb'
 require &quot;#{ENV['TM_BUNDLE_SUPPORT']}/header.rb&quot;
+require &quot;#{ENV['TM_BUNDLE_SUPPORT']}/phpunit.rb&quot;
 
 test_name = TestFinder.find_last_test_before_line(ENV['TM_FILEPATH'], ENV['TM_LINE_NUMBER'])
 is_remote = ENV[&quot;REMOTE_HOST&quot;] &amp;&amp; ENV[&quot;REMOTE_PATH&quot;] &amp;&amp; ENV[&quot;LOCAL_PATH&quot;]
 file = ENV['TM_FILENAME']
 dir = is_remote ? ENV['TM_DIRECTORY'].gsub(/#{ENV['LOCAL_PATH']}/,ENV[&quot;REMOTE_PATH&quot;]) : ENV['TM_DIRECTORY']
 cmd = is_remote ? &quot;ssh #{ENV['REMOTE_HOST']}&quot; : &quot;/bin/sh&quot;
-
 output = `#{cmd} &quot;cd \&quot;#{dir}\&quot;; phpunit --log-xml /tmp/#{file}.xml --filter #{test_name} #{file} &gt; /dev/null; cat /tmp/#{file}.xml; rm /tmp/#{file}.xml&quot;`
-
-
-xml = XML::Document.string(output)
-test_results = []
-
-xml.find(&quot;/testsuites/testsuite/testcase&quot;).each do |tc|
-  testcase = {}
-  testcase['test'] = tc.attributes.get_attribute('name').value.to_s
-  testcase['time'] = tc.attributes.get_attribute('time').value.to_f
-  testcase['assertions'] = tc.attributes.get_attribute('assertions').value.to_i
-  testcase['status'] = 'pass'
-  if tc.children?
-    testcase['status'] = 'fail' 
-    testcase['message'] = tc.find_first('failure/text()').content.gsub(/^\n/, '').gsub(/^\s+\w/, '').gsub(/^.+#{ENV['REMOTE_PATH']}/, ENV['LOCAL_PATH']).escape_html.gsub(/&lt;br&gt;/, '').add_code_links
-  end
-  test_results &lt;&lt; testcase
-end
-
-testsuite = xml.find_first(&quot;/testsuites/testsuite&quot;)
-title = testsuite.attributes.get_attribute('name').value.gsub(/_/,&quot; &quot;)
-
-counts = {}
-counts[:fail] = testsuite.attributes.get_attribute('failures').value.to_i
-counts[:pass] = testsuite.attributes.get_attribute('tests').value.to_i - counts[:fail]
-counts[:assertions] = testsuite.attributes.get_attribute('tests').value.to_i
-overall_status = counts[:fail] &gt; 0 ? 'fail' : 'pass'
-total_time = testsuite.attributes.get_attribute('time').value.to_f
-
+results = PHPUnit::Processor.xml(output)
 puts ERB.new(File.read(&quot;#{ENV['TM_BUNDLE_SUPPORT']}/results.html.erb&quot;)).result(binding)
\ No newline at end of file</diff>
      <filename>Support/run_single_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,39 +3,12 @@ require 'rubygems'
 require 'xml'
 require 'erb'
 require &quot;#{ENV['TM_BUNDLE_SUPPORT']}/header.rb&quot;
+require &quot;#{ENV['TM_BUNDLE_SUPPORT']}/phpunit.rb&quot;
 
 is_remote = ENV[&quot;REMOTE_HOST&quot;] &amp;&amp; ENV[&quot;REMOTE_PATH&quot;] &amp;&amp; ENV[&quot;LOCAL_PATH&quot;]
 file = ENV['TM_FILENAME']
 dir = is_remote ? ENV['TM_DIRECTORY'].gsub(/#{ENV['LOCAL_PATH']}/,ENV[&quot;REMOTE_PATH&quot;]) : ENV['TM_DIRECTORY']
 cmd = is_remote ? &quot;ssh #{ENV['REMOTE_HOST']}&quot; : &quot;/bin/sh&quot;
-
 output = `#{cmd} &quot;cd \&quot;#{dir}\&quot;; phpunit --log-xml /tmp/#{file}.xml #{file} &gt; /dev/null; cat /tmp/#{file}.xml; rm /tmp/#{file}.xml&quot;`
-
-
-xml = XML::Document.string(output)
-test_results = []
-
-xml.find(&quot;/testsuites/testsuite/testcase&quot;).each do |tc|
-  testcase = {}
-  testcase['test'] = tc.attributes.get_attribute('name').value.to_s
-  testcase['time'] = tc.attributes.get_attribute('time').value.to_f
-  testcase['assertions'] = tc.attributes.get_attribute('assertions').value.to_i
-  testcase['status'] = 'pass'
-  if tc.children?
-    testcase['status'] = 'fail' 
-    testcase['message'] = tc.find_first('failure/text()').content.gsub(/^\n/, '').gsub(/^\s+\w/, '').gsub(/^.+#{ENV['REMOTE_PATH']}/, ENV['LOCAL_PATH']).escape_html.gsub(/&lt;br&gt;/, '').add_code_links
-  end
-  test_results &lt;&lt; testcase
-end
-
-testsuite = xml.find_first(&quot;/testsuites/testsuite&quot;)
-title = testsuite.attributes.get_attribute('name').value.gsub(/_/,&quot; &quot;)
-
-counts = {}
-counts[:fail] = testsuite.attributes.get_attribute('failures').value.to_i
-counts[:pass] = testsuite.attributes.get_attribute('tests').value.to_i - counts[:fail]
-counts[:assertions] = testsuite.attributes.get_attribute('tests').value.to_i
-overall_status = counts[:fail] &gt; 0 ? 'fail' : 'pass'
-total_time = testsuite.attributes.get_attribute('time').value.to_f
-
-puts ERB.new(File.read(&quot;#{ENV['TM_BUNDLE_SUPPORT']}/results.html.erb&quot;)).result(binding)
+results = PHPUnit::Processor.xml(output)
+puts ERB.new(File.read(&quot;#{ENV['TM_BUNDLE_SUPPORT']}/results.html.erb&quot;)).result(binding)
\ No newline at end of file</diff>
      <filename>Support/run_tests.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,8 +54,8 @@
 	&lt;array&gt;
 		&lt;string&gt;8228ACD2-6C9D-47CE-B4A6-082DAB1C5649&lt;/string&gt;
 		&lt;string&gt;8A605C02-D7F6-43AD-9126-9965C9EB0E21&lt;/string&gt;
-		&lt;string&gt;BF46602F-3676-44EC-ABF8-225DF9341A9A&lt;/string&gt;
 		&lt;string&gt;46BF4991-44F3-4E95-9055-66E089A159EA&lt;/string&gt;
+		&lt;string&gt;8B95FE77-8E5B-4E41-BF27-69B179CD690C&lt;/string&gt;
 		&lt;string&gt;87754C58-78F6-4BD3-9FD4-BC6B49180863&lt;/string&gt;
 		&lt;string&gt;660B663C-F31B-4811-8970-45EE38238082&lt;/string&gt;
 		&lt;string&gt;0A8A8F33-FD92-476A-A965-33ED423FF6DE&lt;/string&gt;</diff>
      <filename>info.plist</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>Snippets/test.tmSnippet</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>d4dc1fea2b57cc9e358ca0bc442a663e6dbd2803</id>
    </parent>
  </parents>
  <author>
    <name>Christopher Cowan</name>
    <email>ccowan@playpeace-lm.corp.yahoo.com</email>
  </author>
  <url>http://github.com/meritt/phpunit-tmbundle/commit/b277f1f072ed4b0960a3707c4e35400c84e0c46b</url>
  <id>b277f1f072ed4b0960a3707c4e35400c84e0c46b</id>
  <committed-date>2009-06-09T01:03:04-07:00</committed-date>
  <authored-date>2009-06-08T22:25:00-07:00</authored-date>
  <message>Fixing the the curly braces to my liking; Re-factorig the XML processor; Adding support for test suites.

Signed-off-by: Alexey Simonenko &lt;dwarfman@gmail.com&gt;</message>
  <tree>f28b21155dc9f5fd878c005362137629b08fd04b</tree>
  <committer>
    <name>Alexey Simonenko</name>
    <email>dwarfman@gmail.com</email>
  </committer>
</commit>
