Commits

Isidro Merayo Castellano  committed e74d22b Merge

fix merge conflicts

  • Participants
  • Parent commits 05e2c58, 3d7996d
  • Branches phake

Comments (0)

Files changed (6)

   - curl -s http://getcomposer.org/installer | php
   - php composer.phar install
 
-script: vendor/bin/phpunit -c tests
+script: vendor/bin/phpunit
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'phpunit', :cli => '--colors', :tests_path => 'tests',
+        :keep_failed => true, :all_after_pass => true, :command => "./vendor/bin/phpunit" do
+  watch(%r{^tests/.+Test\.php$})
+  watch(%r{^src/(.+)\.php$}) { |m| "tests/#{m[1]}Test.php" }
+end

File composer.json

 {
     "name": "isidromerayo/simple_php_skeleton",
     "description": "Simple skeleton PHP project with Symfony2 components",
-    "keywords": ["test","composer","Helper","TDD","PHPUnit","Phake","Mock/Stub","xUnit"],
+    "keywords": ["test","composer","Helper","TDD","PHPUnit","Test Doubles","Mock","Stub","xUnit"],
     "homepage": "",
     "type": "library",
     "license": "MIT",
     ],
     "require": {
         "php": ">=5.3.3",
-        "symfony/class-loader": "2.0.x-dev",
         "phpunit/phpunit": "3.7.x-dev",
+        "pimple/pimple": "dev-master",
         "phake/phake": "dev-master"
     },
     "autoload": {

File src/bootstrap.php

 <?php
-
 require_once __DIR__  . '/../vendor/autoload.php';
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-
-$autoloader = new UniversalClassLoader();
-$autoloader->register();

File tests/Acme/DependencyInjectionTest.php

+<?php
+namespace Acme;
+
+/**
+ * Description of DependencyInjectionTest
+ *
+ * @author isidromerayo
+ */
+class DependencyInjectionTest extends \PHPUnit_Framework_TestCase
+{
+    public function setUp()
+    {
+        $this->di = new \Pimple();
+        $this->di['param'] = 'value';
+    }
+    /**
+     * @test
+     */
+    public function initialParamValue()
+    {
+        $this->assertEquals('value',$this->di['param']);
+    }
+}

File tests/phpunit.xml.dist

-<phpunit bootstrap="./TestHelper.php" colors="true">
-    <testsuite name="Unit test suite">
-        <directory>./</directory>
-    </testsuite>
-
-    <filter>
-        <whitelist addUncoveredFilesFromWhitelist="true">
-            <directory suffix=".php">../src</directory>
-            <exclude>
-             <file>../src/bootstrap.php</file>
-            </exclude>
-        </whitelist>
-    </filter>
-</phpunit>