Author: Jan Borsodi Date: 2006-12-21 13:23:55 +0100 (Thu, 21 Dec 2006) New Revision: 4431
Log: - Removed Location class and its exception class, it is not used anymore. Removed: trunk/Template/src/exceptions/locator_not_found_exception.php trunk/Template/src/location.php trunk/Template/tests/location_test.php trunk/Template/tests/template_exception_test.php Modified: trunk/Template/src/template_autoload.php trunk/Template/tests/suite.php Deleted: trunk/Template/src/exceptions/locator_not_found_exception.php =================================================================== --- trunk/Template/src/exceptions/locator_not_found_exception.php 2006-12-21 12:17:28 UTC (rev 4430) +++ trunk/Template/src/exceptions/locator_not_found_exception.php 2006-12-21 12:23:55 UTC (rev 4431) @@ -1,31 +0,0 @@ -<?php -/** - * File containing the ezcTemplateLocatorNotFoundException class - * - * @package Template - * @version //autogen// - * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - */ - -/** - * Exception for missing locator handlers in the template manager. The tried - * location object is passed to the constructor. - * - * @package Template - * @version //autogen// - */ -class ezcTemplateLocatorNotFoundException extends ezcTemplateException -{ - /** - * Initialises the exception with the location object $location which - * contains the locator which is missing. - * - * @param string $locator The ezcTemplateLocation object. - */ - public function __construct( ezcTemplateLocation $location ) - { - parent::__construct( "The requested template location '{$location->locationString()}' could not be processed, the locator '{$location->locator}' was not found in the manager." ); - } -} -?> Deleted: trunk/Template/src/location.php =================================================================== --- trunk/Template/src/location.php 2006-12-21 12:17:28 UTC (rev 4430) +++ trunk/Template/src/location.php 2006-12-21 12:23:55 UTC (rev 4431) @@ -1,51 +0,0 @@ -<?php -/** - * File containing the ezcTemplateLocation class - * - * @package Template - * @version //autogen// - * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @access private - */ -/** - * Struct which encapsulates the locator and stream string for a template request. - * - * @package Template - * @version //autogen// - * @access private - */ -class ezcTemplateLocation -{ - - /** - * The identifier of the locator handler (subclass of ezcTemplateSourceLocator). - * @var string - */ - public $locator; - - /** - * The PHP stream defining the location of the source file. - * @var string - */ - public $stream; - - /** - * Initialises the locator and stream string. - */ - public function __construct( $locator, $stream ) - { - $this->locator = $locator; - $this->stream = $stream; - } - - /** - * Returns a location string which is created from the locator identifier and the stream path. - */ - public function locationString() - { - return ( $this->locator !== false ? $this->locator . ':' : '' ) . $this->stream; - } - -} -?> Modified: trunk/Template/src/template_autoload.php =================================================================== --- trunk/Template/src/template_autoload.php 2006-12-21 12:17:28 UTC (rev 4430) +++ trunk/Template/src/template_autoload.php 2006-12-21 12:23:55 UTC (rev 4431) @@ -16,7 +16,6 @@ "ezcTemplateConfiguration" => "Template/configuration.php", "ezcTemplateAutoloaderDefinition" => "Template/structs/autoloader_definition.php", "ezcTemplateVariableCollection" => "Template/variable_collection.php", - "ezcTemplateLocation" => "Template/location.php", "ezcTemplateParser" => "Template/parser.php", "ezcTemplateCursor" => "Template/cursor.php", Deleted: trunk/Template/tests/location_test.php =================================================================== --- trunk/Template/tests/location_test.php 2006-12-21 12:17:28 UTC (rev 4430) +++ trunk/Template/tests/location_test.php 2006-12-21 12:23:55 UTC (rev 4431) @@ -1,34 +0,0 @@ -<?php -/** - * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @version //autogentag// - * @filesource - * @package Template - * @subpackage Tests - */ - -/** - * @package Template - * @subpackage Tests - */ -class ezcTemplateLocationTest extends ezcTestCase -{ - public static function suite() - { - return new PHPUnit_Framework_TestSuite( "ezcTemplateLocationTest" ); - } - - /** - * Test passing constructor values - */ - public function testInit() - { - $location = new ezcTemplateLocation( "planet", "Z'ha'dum" ); - - self::assertSame( "planet", $location->locator, 'Property <locator> does not return correct value.' ); - self::assertSame( "Z'ha'dum", $location->stream, 'Property <stream> does not return correct value.' ); - } -} - -?> Modified: trunk/Template/tests/suite.php =================================================================== --- trunk/Template/tests/suite.php 2006-12-21 12:17:28 UTC (rev 4430) +++ trunk/Template/tests/suite.php 2006-12-21 12:23:55 UTC (rev 4431) @@ -12,9 +12,6 @@ require_once 'variable_collection_test.php'; -require_once 'location_test.php'; -require_once 'template_exception_test.php'; - require_once 'validation_item_test.php'; require_once 'output_context_test.php'; require_once 'xhtml_context_test.php'; @@ -62,9 +59,6 @@ $this->addTest( ezcTemplateVariableCollectionTest::suite() ); - $this->addTest( ezcTemplateLocationTest::suite() ); - $this->addTest( ezcTemplateExceptionTest::suite() ); - $this->addTest( ezcTemplateValidationItemTest::suite() ); $this->addTest( ezcTemplateOutputContextTest::suite() ); Deleted: trunk/Template/tests/template_exception_test.php =================================================================== --- trunk/Template/tests/template_exception_test.php 2006-12-21 12:17:28 UTC (rev 4430) +++ trunk/Template/tests/template_exception_test.php 2006-12-21 12:23:55 UTC (rev 4431) @@ -1,35 +0,0 @@ -<?php -/** - * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. - * @license http://ez.no/licenses/new_bsd New BSD License - * @version //autogentag// - * @filesource - * @package Template - * @subpackage Tests - */ - -/** - * @package Template - * @subpackage Tests - */ - -class ezcTemplateExceptionTest extends ezcTestCase -{ - public static function suite() - { - return new PHPUnit_Framework_TestSuite( "ezcTemplateExceptionTest" ); - } - - /** - * Test 'locator not found' constructor values - */ - public function testLocatorNotFound() - { - $e = new ezcTemplateLocatorNotFoundException( new ezcTemplateLocation( 'design', 'some/place/nice.tpl' ) ); - - self::assertSame( "The requested template location 'design:some/place/nice.tpl' could not be processed, the locator 'design' was not found in the manager.", $e->getMessage(), - 'Exception message is not correct' ); - } -} - -?> -- svn-components mailing list [email protected] http://lists.ez.no/mailman/listinfo/svn-components
