1. Isidro Merayo Castellano
  2. virtual-proxies

Commits

Isidro Merayo Castellano  committed 62a411c

minimal structure PHP project

  • Participants
  • Branches master

Comments (0)

Files changed (7)

File .gitignore

View file
  • Ignore whitespace
+# https://github.com/github/gitignore
+
+## generic files to ignore
+*~
+*.lock
+*.DS_Store
+*.swp
+*.out
+
+##
+# composer 
+##
+composer.phar
+composer.lock
+
+##
+# components, libraries, etc
+##
+vendor
+
+##
+# Symfon2 - https://github.com/github/gitignore/blob/master/Symfony2.gitignore
+##
+
+# Bootstrap
+app/bootstrap*
+
+# Symfony directories
+vendor/*
+*/logs/*
+*/cache/*
+web/uploads/*
+web/bundles/*
+
+# Configuration files
+app/config/parameters.ini
+app/config/parameters.yml
+
+##
+# Netbeans
+##
+nbproject
+
+
+##
+# Eclipse - https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore
+##
+
+*.pydevproject
+.project
+.metadata
+bin/**
+tmp/**
+tmp/**/*
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath

File README

View file
  • Ignore whitespace
+Simple Skeleton PHP project: Composer and Symfony2 components
+=============================================================
+
+A simple skeleton PHP project, using composer and Symfon2 Components.
+
+PSR-0
+
+Install
+=======
+
+$ git clone https://github.com/isidromerayo/skeleton_PHP_project
+$ curl -s http://getcomposer.org/installer | php
+$ php composer.phar install
+
+Using
+=====
+
+Create your test under "tests" directory.
+Create your code under "src" directory.
+
+$ phpunit -c tests/

File composer.json

View file
  • Ignore whitespace
+{
+    "name": "simple_skeleton",
+    "description": "Simple skeleton PHP project with Symfony2 components",
+    "keywords": ["test","composer","helper","TDD","PHPUnit"],
+    "homepage": "",
+    "type": "library",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Isidro Merayo Castellano",
+            "homepage": "https://github.com/isidromerayo"
+        }
+    ],
+    "require": {
+        "php":              ">=5.3.2",
+        "symfony/class-loader": "2.0.x-dev"
+    },
+    "autoload" : {
+        "psr-0" : {
+            "Acme" : "src/"
+        }
+    }
+}

File src/Acme/Dummy.php

View file
  • Ignore whitespace
+<?php
+namespace Acme;
+/**
+ * Dummy class
+ *
+ * @author isidromerayo
+ */
+class Dummy 
+{
+
+}

File tests/Acme/DummyTest.php

View file
  • Ignore whitespace
+<?php
+
+namespace Acme;
+
+/**
+ * Description of DummyTest
+ *
+ * @author isidromerayo
+ */
+class DummyTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @test
+     */
+    public function sayHello()
+    {
+        $this->markTestIncomplete('TODO');
+    }
+}

File tests/TestHelper.php

View file
  • Ignore whitespace
+<?php
+date_default_timezone_set('Europe/Madrid');
+
+error_reporting(E_ALL | E_STRICT);
+
+require_once __DIR__.'/../vendor/autoload.php';

File tests/phpunit.xml.dist

View file
  • Ignore whitespace
+<phpunit bootstrap="./TestHelper.php" colors="true">
+    <testsuite name="Unit test suite">
+        <directory>./</directory>
+    </testsuite>
+
+    <filter>
+        <whitelist>
+            <directory suffix=".php">../src/</directory>
+        </whitelist>
+    </filter>
+</phpunit>