Skip to content
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
2 changes: 1 addition & 1 deletion Resource/template/admin/order_pdf.twig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

{% block main %}
<div class="row" id="aside_wrap">
<form role="form" name="order_pdf_form" id="order_pdf_form" method="post" action="{{ url('plugin_admin_order_pdf_download') }}">
<form role="form" name="order_pdf_form" id="order_pdf_form" method="post" action="{{ url('admin_plugin_order_pdf_download') }}">
{{ form_widget(form._token) }}
<div class="col-md-9">
<div class="box accordion">
Expand Down
2 changes: 1 addition & 1 deletion Resource/template/admin/order_pdf_menu.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
* file that was distributed with this source code.
*/
#}
<li><a href="{{ url('plugin_admin_order_pdf') }}" >帳票出力</a></li>
<li><a href="{{ url('admin_plugin_order_pdf') }}" >帳票出力</a></li>
8 changes: 6 additions & 2 deletions ServiceProvider/OrderPdfServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ public function register(BaseApplication $app)
}
// 帳票の作成
$admin->match('/plugin/order-pdf', '\\Plugin\\OrderPdf\\Controller\\OrderPdfController::index')
->bind('plugin_admin_order_pdf');
->bind('admin_plugin_order_pdf');
$admin->match('/plugin/order-pdf', '\\Plugin\\OrderPdf\\Controller\\OrderPdfController::index')
->bind('plugin_admin_order_pdf'); // deprecated

// PDFファイルダウンロード
$admin->post('/plugin/order-pdf/download', '\\Plugin\\OrderPdf\\Controller\\OrderPdfController::download')
->bind('plugin_admin_order_pdf_download');
->bind('admin_plugin_order_pdf_download');
$admin->post('/plugin/order-pdf/download', '\\Plugin\\OrderPdf\\Controller\\OrderPdfController::download')
->bind('plugin_admin_order_pdf_download'); // deprecated

$app->mount('/'.trim($app['config']['admin_route'], '/').'/', $admin);

Expand Down
16 changes: 8 additions & 8 deletions Tests/Web/OrderPdfControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testRenderDownloadWithDefault()
/**
* @var Crawler $crawler
*/
$crawler = $client->request('GET', $this->app->url('plugin_admin_order_pdf').'?ids'.$orderId.'=on');
$crawler = $client->request('GET', $this->app->url('admin_plugin_order_pdf').'?ids'.$orderId.'=on');
$html = $crawler->filter('.box-body')->html();
$this->assertContains((string) $orderId, $html);
$this->assertContains('お買上げ明細書(納品書)', $html);
Expand All @@ -90,7 +90,7 @@ public function testRenderDownloadWithPreviousInput()
/**
* @var Crawler $crawler
*/
$crawler = $client->request('GET', $this->app->url('plugin_admin_order_pdf').'?ids'.$orderId.'=on');
$crawler = $client->request('GET', $this->app->url('admin_plugin_order_pdf').'?ids'.$orderId.'=on');
$form = $this->getForm($crawler);
/**
* @var Generator $faker
Expand All @@ -109,7 +109,7 @@ public function testRenderDownloadWithPreviousInput()
$this->expected = 'application/pdf';
$this->verify();

$crawler = $client->request('GET', $this->app->url('plugin_admin_order_pdf').'?ids'.$orderId.'=on');
$crawler = $client->request('GET', $this->app->url('admin_plugin_order_pdf').'?ids'.$orderId.'=on');
$html = $crawler->filter('.box-body')->html();

$this->assertContains((string) $orderId, $html);
Expand All @@ -132,7 +132,7 @@ public function testDownloadIdInvalid()
*/
$client = $this->client;

$client->request('GET', $this->app->url('plugin_admin_order_pdf'));
$client->request('GET', $this->app->url('admin_plugin_order_pdf'));
$this->assertTrue($client->getResponse()->isRedirect($this->app->url('admin_order')));
/**
* @var Crawler $crawler
Expand All @@ -154,7 +154,7 @@ public function testDownloadWithBadMethod()
*/
$client = $this->client;

$client->request('GET', $this->app->url('plugin_admin_order_pdf_download'));
$client->request('GET', $this->app->url('admin_plugin_order_pdf_download'));

$this->assertTrue($this->hasFailed());
}
Expand All @@ -179,7 +179,7 @@ public function testDownloadMaxLength($field, $message)
/**
* @var Crawler $crawler
*/
$crawler = $client->request('GET', $this->app->url('plugin_admin_order_pdf').'?ids'.$orderId.'=on');
$crawler = $client->request('GET', $this->app->url('admin_plugin_order_pdf').'?ids'.$orderId.'=on');
$html = $crawler->filter('.box-body')->html();
$this->assertContains((string) $orderId, $html);
$this->assertContains('お買上げ明細書(納品書)', $html);
Expand Down Expand Up @@ -233,7 +233,7 @@ public function testDownloadSuccess()
/**
* @var Crawler $crawler
*/
$crawler = $client->request('GET', $this->app->url('plugin_admin_order_pdf').'?ids'.$orderId.'=on');
$crawler = $client->request('GET', $this->app->url('admin_plugin_order_pdf').'?ids'.$orderId.'=on');
$html = $crawler->filter('.box-body')->html();
$this->assertContains((string) $orderId, $html);
$this->assertContains('お買上げ明細書(納品書)', $html);
Expand Down Expand Up @@ -286,7 +286,7 @@ public function testDownloadWithPreviousInputSuccess()
$this->app['orm.em']->persist($OrderPdf);
$this->app['orm.em']->flush($OrderPdf);

$crawler = $client->request('GET', $this->app->url('plugin_admin_order_pdf').'?ids'.$orderId.'=on');
$crawler = $client->request('GET', $this->app->url('admin_plugin_order_pdf').'?ids'.$orderId.'=on');
$html = $crawler->filter('.box-body')->html();

$this->assertContains((string) $orderId, $html);
Expand Down