Skip to content

Commit

Permalink
Merge 08dddfe into bba4297
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Jun 26, 2018
2 parents bba4297 + 08dddfe commit a2da7b5
Show file tree
Hide file tree
Showing 129 changed files with 1,502 additions and 1,317 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ composer.phar
!/html/template/install
/html/user_data/*
!/html/user_data/.gitkeep
/phpunit.xml
/src/Eccube/Resource/config/*.dist.php
/tests/tmp/*
/reports/*
Expand Down
130 changes: 118 additions & 12 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,125 @@ build_failure_conditions:
- 'project.metric_change("scrutinizer.test_coverage", < -0.10)'

filter:
paths: ["src/*"]
excluded_paths:
- vendor/*
- tests/*
- docs/*
- html/template/**/js/vendor/*
- html/template/**/**/js/vendor/*
- src/Eccube/Entity/*
- 'app/*'
- 'tests/*'
- 'codeception/*'
- 'var/*'
dependency_paths:
- vendor/
checks:
php:
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
coding_style:
php:
indentation:
general:
use_tabs: false
size: 4
switch:
indent_case: true
spaces:
general:
linefeed_character: newline
before_parentheses:
function_declaration: false
closure_definition: true
function_call: false
if: true
for: true
while: true
switch: true
catch: true
array_initializer: false
around_operators:
assignment: true
logical: true
equality: true
relational: true
bitwise: true
additive: true
multiplicative: true
shift: true
unary_additive: false
concatenation: false
negation: false
before_left_brace:
class: true
function: true
if: true
else: true
for: true
while: true
do: true
switch: true
try: true
catch: true
finally: true
before_keywords:
else: true
while: true
catch: true
finally: true
within:
brackets: false
array_initializer: false
grouping: false
function_call: false
function_declaration: false
if: false
for: false
while: false
switch: false
catch: false
type_cast: false
ternary_operator:
before_condition: true
after_condition: true
before_alternative: true
after_alternative: true
in_short_version: false
other:
before_comma: false
after_comma: true
before_semicolon: false
after_semicolon: true
after_type_cast: true
braces:
classes_functions:
class: undefined
function: undefined
closure: undefined
if:
opening: undefined
always: true
else_on_new_line: false
for:
opening: undefined
always: true
while:
opening: undefined
always: true
do_while:
opening: undefined
always: true
while_on_new_line: false
switch:
opening: undefined
try:
opening: undefined
catch_on_new_line: false
finally_on_new_line: false
upper_lower_casing:
keywords:
general: undefined
constants:
true_false_null: undefined

tools:
# Runs the JSHint static analysis tool (https://scrutinizer-ci.com/docs/tools/javascript/jshint/)
Expand Down Expand Up @@ -79,9 +191,3 @@ tools:
enabled: true

sensiolabs_security_checker: true

checks:
php:
custom_coding_standard:
git_repository: 'https://github.com/M6Web/Symfony2-coding-standard'
ruleset_path: 'Symfony2/ruleset.xml'
24 changes: 20 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ eccube_setup: &eccube_setup |
bin/console eccube:fixtures:load

jobs:
fast_finish: true
allow_failures:
- env: DATABASE_URL=sqlite:///%kernel.project_dir%/var/eccube.db DATABASE_SERVER_VERSION=3 COVERAGE=1
include:
- stage: Inspection
php: 7.1
env: DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
script: vendor/bin/php-cs-fixer fix --config=.php_cs.dist --dry-run
- &unit_test
stage: Unit Test
before_install:
Expand Down Expand Up @@ -79,3 +78,20 @@ jobs:
env: GROUP=admin03 APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
- <<: *e2e_test
env: GROUP=front APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
- &coverage
stage: Code Coverage
env: DATABASE_URL=sqlite:///%kernel.project_dir%/var/eccube.db DATABASE_SERVER_VERSION=3 COVERAGE=1
before_install:
- *php_setup
- gem install mailcatcher
install:
- *composer_install
- *eccube_setup
script:
- docker run -e DATABASE_URL=sqlite:////usr/src/myapp/var/eccube.db -v "$PWD":/usr/src/myapp:cached -w /usr/src/myapp --rm nanasess/phpdbg phpdbg -qrr -dmemory_limit=-1 ./bin/phpunit --exclude-group cache-clear --coverage-clover=coverage.clover
after_success:
- sed -i.bak -e 's|/usr/src/myapp/||g' coverage.clover
- php vendor/bin/php-coveralls -v -x coverage.clover
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

This file was deleted.

29 changes: 29 additions & 0 deletions app/Plugin/TwigUserFunc/TwigBlock.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
*
* http://www.lockon.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Plugin\TwigUserFunc;

use Eccube\Common\EccubeTwigBlock;

class TwigBlock implements EccubeTwigBlock
{
/**
* @return array
*/
public static function getTwigBlock()
{
return [
'@TwigUserFunc/hello_block.twig',
];
}
}
3 changes: 1 addition & 2 deletions app/config/eccube/packages/eccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ parameters:
eccube_theme_front_default_dir: '%eccube_theme_src_dir%/default'
eccube_theme_admin_dir: '%eccube_theme_app_dir%/admin'
eccube_theme_admin_default_dir: '%eccube_theme_src_dir%/admin'
eccube_twig_block_templates:
- 'render_block.twig'
eccube_twig_block_templates: []
eccube_save_image_dir: '%kernel.project_dir%/html/upload/save_image'
eccube_temp_image_dir: '%kernel.project_dir%/html/upload/temp_image'
eccube_csv_size: 5 # post_max_size, upload_max_filesize に任せればよい?
Expand Down
12 changes: 9 additions & 3 deletions codeception/_support/Page/Admin/FileManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function 入力_フォルダ名($value)

public function フォルダ作成()
{
$this->tester->click('#aside_wrap > form > div.col-md-9 > div > div.box-header.form-horizontal > div.form-group.form-inline > div > a');
$this->tester->click('#form1 a.action-create');
return $this;
}

Expand All @@ -58,13 +58,19 @@ public function 一覧_ダウンロード($rowNum)

public function 一覧_表示($rowNum)
{
$this->tester->click("#aside_wrap > form > div.col-md-9 > div > div.box-body > div > div > table > tbody > tr:nth-child(${rowNum}) > td:nth-child(4) > a");
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-view");
return $this;
}

public function 一覧_削除($rowNum)
{
$this->tester->click("#aside_wrap > form > div.col-md-9 > div > div.box-body > div > div > table > tbody > tr:nth-child(${rowNum}) > td:nth-child(6) > a");
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) a.action-delete");
return $this;
}

public function 一覧_削除_accept($rowNum)
{
$this->tester->click("#fileList table > tbody > tr:nth-child(${rowNum}) > td:nth-child(5) > div > div:nth-child(3) div.modal a.btn-ec-delete");
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion codeception/_support/Page/Admin/TaxManagePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function 一覧_編集($rowNum)

public function 一覧_削除($rowNum)
{
$this->tester->click("table tbody tr:nth-child(${rowNum}) > td.align-middle.action > div > div:nth-child(2) > a");
$this->tester->click("table tbody tr:nth-child(${rowNum}) > td.align-middle.action > div > div div:nth-child(2) > a");
$this->tester->acceptPopup();
return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions codeception/_support/Page/Front/CartPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public function 商品数量($index)

public function 商品数量増やす($index)
{
$this->tester->click(["xpath" => "//div[@class='ec-cartRole']//ul[@class='ec-cartRow'][position()=${index}]//div[@class='ec-cartRow__amountUpDown']/a[@class='ec-cartRow__amountUpButton']"]);
$this->tester->click(["xpath" => "//div[@class='ec-cartRole']//ul[@class='ec-cartRow'][position()=${index}]//div[@class='ec-cartRow__amountUpDown']/a[contains(@class, 'ec-cartRow__amountUpButton')]"]);
return $this;
}

public function 商品数量減らす($index)
{
$this->tester->click(["xpath" => "//div[@class='ec-cartRole']//ul[@class='ec-cartRow'][position()=${index}]//div[@class='ec-cartRow__amountUpDown']/a[@class='ec-cartRow__amountDownButton']"]);
$this->tester->click(["xpath" => "//div[@class='ec-cartRole']//ul[@class='ec-cartRow'][position()=${index}]//div[@class='ec-cartRow__amountUpDown']/a[contains(@class, 'ec-cartRow__amountDownButton')]"]);
return $this;
}

Expand Down
16 changes: 7 additions & 9 deletions codeception/acceptance/EA06ContentsManagementCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ public function contentsmanagement_ファイル管理(\AcceptanceTester $I)

$I->see('upload.txt', $FileManagePage->ファイル名(1));

$I->getScenario()->incomplete('Incompleted caused by not implement download yet');

$FileManagePage->一覧_ダウンロード(1);
$UploadedFile = $I->getLastDownloadFile('/^upload\.txt$/');
$I->assertEquals('This is uploaded file.', file_get_contents($UploadedFile));
Expand All @@ -93,8 +91,8 @@ public function contentsmanagement_ファイル管理(\AcceptanceTester $I)
$I->see('This is uploaded file.');

FileManagePage::go($I)
->一覧_削除(1);
$I->acceptPopup();
->一覧_削除(1)
->一覧_削除_accept(1);
$I->dontSee('upload.txt', $FileManagePage->ファイル名(1));

$FileManagePage = FileManagePage::go($I)
Expand All @@ -103,17 +101,17 @@ public function contentsmanagement_ファイル管理(\AcceptanceTester $I)

$I->see('folder1', $FileManagePage->ファイル名(1));

$FileManagePage->一覧_表示(1);
$I->see('folder1', $FileManagePage->パンくず(1));
// Todo: breadcrumbs incomplete
// $FileManagePage->一覧_表示(1);
// $I->see('folder1', $FileManagePage->パンくず(1));

$config = Fixtures::get('config');
$I->amOnPage('/'.$config['eccube_admin_route'].'/content/file_manager');
$I->see('ファイル管理コンテンツ管理', '.c-pageTitle');

// Todo: change to modal
FileManagePage::go($I)
->一覧_削除(1);
$I->acceptPopup();
->一覧_削除(1)
->一覧_削除_accept(1);
}

public function contentsmanagement_ページ管理(\AcceptanceTester $I)
Expand Down
Loading

0 comments on commit a2da7b5

Please sign in to comment.