mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-16 19:05:05 +00:00
Updated PHP version for PHP7.2+
Removed PHP5 (no longer supported) Renamed PHP7 to PHP - consistent with other kata Added the same helpers as other PHP Kata Updated the code to PHP7.2+ standard Didn't change GildedRose updateQuality method Updated GildedRoseTest (still failing) Added ApprovalTest (passing) - same text file as texttests / ThirtyDays / stdout.gr (only renamed).
This commit is contained in:
1 parent
fbe24e35b5
commit
ed7a787e4f
34 files changed
+5576
-1794
No files matched your search
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<buildpath>
|
||||
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
|
||||
<buildpathentry kind="src" path="src"/>
|
||||
<buildpathentry kind="src" path="test"/>
|
||||
<buildpathentry kind="con" path="org.eclipse.dltk.USER_LIBRARY/PEAR"/>
|
||||
</buildpath>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>GildedRose.php</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.dltk.core.scriptbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.php.core.PHPNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,10 +0,0 @@
|
||||
cakephp_app_path=
|
||||
cakephp_core_path=
|
||||
ciunit_config_file=
|
||||
ciunit_path=
|
||||
eclipse.preferences.version=1
|
||||
phpunit_config_file=/GildedRose.php/phpunit.xml
|
||||
preload_script=
|
||||
test_file_pattern=.*test\\.php$
|
||||
test_folders=/GildedRose.php/test
|
||||
testing_framework=PHPUnit
|
||||
@@ -1,2 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
include_path=0;/GildedRose.php/test\u00050;/GildedRose.php/src\u00055;org.eclipse.dltk.USER_LIBRARY/PEAR
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="php.component"/>
|
||||
<fixed facet="php.core.component"/>
|
||||
<installed facet="php.core.component" version="1"/>
|
||||
<installed facet="php.component" version="5.4"/>
|
||||
</faceted-project>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
bootstrap="test/bootstrap.php"
|
||||
colors="false"
|
||||
strict="true"
|
||||
verbose="true">
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="AllTests">
|
||||
<directory suffix="_test.php">test</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
</phpunit>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'gilded_rose.php';
|
||||
|
||||
echo "OMGHAI!\n";
|
||||
|
||||
$items = array(
|
||||
new Item('+5 Dexterity Vest', 10, 20),
|
||||
new Item('Aged Brie', 2, 0),
|
||||
new Item('Elixir of the Mongoose', 5, 7),
|
||||
new Item('Sulfuras, Hand of Ragnaros', 0, 80),
|
||||
new Item('Sulfuras, Hand of Ragnaros', -1, 80),
|
||||
new Item('Backstage passes to a TAFKAL80ETC concert', 15, 20),
|
||||
new Item('Backstage passes to a TAFKAL80ETC concert', 10, 49),
|
||||
new Item('Backstage passes to a TAFKAL80ETC concert', 5, 49),
|
||||
// this conjured item does not work properly yet
|
||||
new Item('Conjured Mana Cake', 3, 6)
|
||||
);
|
||||
|
||||
$app = new GildedRose($items);
|
||||
|
||||
$days = 2;
|
||||
if (count($argv) > 1) {
|
||||
$days = (int) $argv[1];
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $days; $i++) {
|
||||
echo("-------- day $i --------\n");
|
||||
echo("name, sellIn, quality\n");
|
||||
foreach ($items as $item) {
|
||||
echo $item . PHP_EOL;
|
||||
}
|
||||
echo PHP_EOL;
|
||||
$app->update_quality();
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
<?php
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/../src');
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'gilded_rose.php';
|
||||
|
||||
class GildedRoseTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function testFoo() {
|
||||
$items = array(new Item("foo", 0, 0));
|
||||
$gildedRose = new GildedRose($items);
|
||||
$gildedRose->update_quality();
|
||||
$this->assertEquals("fixme", $items[0]->name);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user