Skip to content
Permalink
Browse files

Add test for #11620

Ensure that controller names with length equal to the view subDir still
have the subdirectory applied.
  • Loading branch information...
markstory committed Jan 25, 2018
1 parent 4c3638f commit 7134214693c9d8be0abfb8d7acb578198347d75d
Showing with 23 additions and 0 deletions.
  1. +21 −0 tests/TestCase/View/ViewTest.php
  2. +2 −0 tests/test_app/TestApp/Template/Jobs/json/index.ctp
@@ -675,6 +675,27 @@ public function testGetViewFileNameSubDir()
$this->assertPathEquals($expected, $result);
}
/**
* Test getViewFileName applies subdirectories on equal length names
*
* @return void
*/
public function testGetViewFileNameSubDirLength()
{
$viewOptions = [
'plugin' => null,
'name' => 'Jobs',
'viewPath' => 'Jobs',
'layoutPath' => 'json',
];
$view = new TestView(null, null, null, $viewOptions);
$view->subDir = 'json';
$result = $view->getViewFileName('index');
$expected = TEST_APP . 'TestApp' . DS . 'Template' . DS . 'Jobs' . DS . 'json' . DS . 'index.ctp';
$this->assertPathEquals($expected, $result);
}
/**
* Test getting layout filenames
*
@@ -0,0 +1,2 @@
<?php
// used to test subdir path additions.

0 comments on commit 7134214

Please sign in to comment.
You can’t perform that action at this time.