Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Travis CI and Coveralls #4

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# for php-coveralls
service_name: travis-ci
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
./id
./id
.idea/
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@ sudo: false
php:
- 5.6.18

before_install:
- composer require phpunit/phpunit:4.8.* satooshi/php-coveralls:dev-master
- composer install --dev
before_script:
- composer install

script:
- mkdir -p build/logs
- phpunit --coverage-clover build/logs/clover.xml
install:
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- chmod +x coveralls.phar
- php coveralls.phar --version

after_script:
- php vendor/bin/coveralls -v
script:
- mkdir -p build/logs
- php vendor/bin/phpunit -c phpunit.xml.dist
- ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml

#install:
# - ./bin/ci/install_dependencies.sh
# - php vendor/vendors.php
after_success:
- travis_retry php vendor/bin/coveralls
- travis_retry php coveralls.phar -v

notifications:
email: false
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f4d7cb3db2cd4fb6a2080249564ca123)](https://www.codacy.com/app/davidmeimoun/PSI?utm_source=github.com&utm_medium=referral&utm_content=davidmeimoun/PSI&utm_campaign=badger)

[![Build Status](https://travis-ci.org/davidmeimoun/PSI.svg?branch=master)](https://travis-ci.org/davidmeimoun/PSI)
[![Build Status](https://travis-ci.org/MamadouBabaMakadji/PSI.svg?branch=master)](https://travis-ci.org/MamadouBabaMakadji/PSI)

[![Coverage Status](https://coveralls.io/repos/github/MamadouBabaMakadji/PSI/badge.png?branch=master)](https://coveralls.io/github/MamadouBabaMakadji/PSI?branch=master)

Phase d'initialisation.
Pour utiliser le projet sur windows, Requis Uwamp 3.0.2, php 5.6.18
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"require": {
"silex/silex": "~2.0",
"doctrine/dbal": "~2.5",
"phpunit/phpunit": "~4.8",
"phpunit/phpunit": "~4.8",
"symfony/browser-kit": "~2.8|3.0.*",
"symfony/css-selector": "~2.8|3.0.*"
},
"require-dev": {
"phpunit/phpunit": "^4.0",
"satooshi/php-coveralls": "^1.0"
},
"autoload": {
"psr-4": {"PSI\\": "src"}
}
Expand Down
36 changes: 25 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "vendor/autoload.php">
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "vendor/autoload.php">

<filter>
<whitelist addUncoveredFilesFromWhitelist="true"
processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
<directory suffix=".php">./tests</directory>
</whitelist>
</filter>

<testsuites>
<testsuite name="GestionnaireLivret">
<directory>tests</directory>
<directory>./tests/Tests</directory>
</testsuite>
</testsuites>


<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
55 changes: 46 additions & 9 deletions src/Domain/Cours.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

class Cours
{


/**
* Article id.
*
Expand All @@ -25,30 +27,65 @@ class Cours
*/
private $content;

public function getId() {
/**
* Cours constructor.
* @param int $id
* @param string $title
* @param string $content
*/
public function __construct($id, $title, $content)
{
$this->id = $id;
$this->title = $title;
$this->content = $content;
}

/**
* @return int
*/
public function getId()
{
return $this->id;
}

public function setId($id) {
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
return $this;
}

public function getTitle() {
/**
* @return string
*/
public function getTitle()
{
return $this->title;
}

public function setTitle($title) {
/**
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}

public function getContent() {
/**
* @return string
*/
public function getContent()
{
return $this->content;
}

public function setContent($content) {
/**
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}

}
File renamed without changes.