Skip to content

Commit

Permalink
[test] fixed return type, add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Dec 18, 2023
1 parent f6e38f0 commit 2a0c3f7
Show file tree
Hide file tree
Showing 19 changed files with 422 additions and 1 deletion.
39 changes: 39 additions & 0 deletions tests/fixtures/ApplicationTask.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class ApplicationTask extends sfBaseTask
{
protected function configure()
{
$this->addOption('application', null, sfCommandOption::PARAMETER_REQUIRED, '', true);
}

protected function execute($arguments = array(), $options = array())
{
if (!$this->configuration instanceof sfApplicationConfiguration) {
throw new Exception('This task requires an application configuration be loaded.');
}
}

public function getServiceContainer()
{
return parent::getServiceContainer();
}

public function getRouting()
{
return parent::getRouting();
}

public function getMailer()
{
return parent::getMailer();
}
}
17 changes: 17 additions & 0 deletions tests/fixtures/FakeValidator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class FakeValidator extends sfValidatorDecorator
{
protected function getValidator()
{
return 'foo';
}
}
31 changes: 31 additions & 0 deletions tests/fixtures/FormListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class FormListener
{
public $events = array();

public function listen(sfEvent $event)
{
$this->events[] = func_get_args();
}

public function filter(sfEvent $event, $value)
{
$this->events[] = func_get_args();

return $value;
}

public function reset()
{
$this->events = array();
}
}
17 changes: 17 additions & 0 deletions tests/fixtures/ProjectLoader2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class ProjectLoader2 extends sfServiceContainerLoaderArray
{
public function validate($content)
{
return parent::validate($content);
}
}
40 changes: 40 additions & 0 deletions tests/fixtures/ProjectServiceContainer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class ProjectServiceContainer extends sfServiceContainer
{
public $__bar;
public $__foo_bar;
public $__foo_baz;

public function __construct()
{
parent::__construct();

$this->__bar = new stdClass();
$this->__foo_bar = new stdClass();
$this->__foo_baz = new stdClass();
}

protected function getBarService()
{
return $this->__bar;
}

protected function getFooBarService()
{
return $this->__foo_bar;
}

protected function getFoo_BazService()
{
return $this->__foo_baz;
}
}
20 changes: 20 additions & 0 deletions tests/fixtures/TestForm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class TestForm extends sfFormSymfony
{
public function configure()
{
$this->setValidators(array(
'first_name' => new sfValidatorString(),
'last_name' => new sfValidatorString(),
));
}
}
22 changes: 22 additions & 0 deletions tests/fixtures/TestLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class TestLogger extends sfFileLogger
{
public function getTimeFormat()
{
return $this->timeFormat;
}

protected function getPriority($priority)
{
return '*'.$priority.'*';
}
}
24 changes: 24 additions & 0 deletions tests/fixtures/TestTask.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class TestTask extends sfBaseTask
{
protected function execute($arguments = array(), $options = array()) {}

public function reloadAutoload()
{
parent::reloadAutoload();
}

public function initializeAutoload(sfProjectConfiguration $configuration, $reload = false)
{
parent::initializeAutoload($configuration, $reload);
}
}
17 changes: 17 additions & 0 deletions tests/fixtures/ValidatorChoiceTestIsEmpty.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class ValidatorChoiceTestIsEmpty extends sfValidatorChoice
{
public function run($value)
{
return $this->isEmpty($value);
}
}
21 changes: 21 additions & 0 deletions tests/fixtures/configuredView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class configuredView extends myView
{
public static $isDecorated = false;

public function initialize($context, $moduleName, $actionName, $viewName)
{
$this->setDecorator(self::$isDecorated);

parent::initialize($context, $moduleName, $actionName, $viewName);
}
}
22 changes: 22 additions & 0 deletions tests/fixtures/myFilesystem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class myFilesystem extends sfFilesystem
{
public function calculateRelativeDir($from, $to)
{
return parent::calculateRelativeDir($from, $to);
}

public function canonicalizePath($path)
{
return parent::canonicalizePath($path);
}
}
19 changes: 19 additions & 0 deletions tests/fixtures/myLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class myLogger extends sfLogger
{
public $log = '';

protected function doLog($message, $priority)
{
$this->log .= $message;
}
}
19 changes: 19 additions & 0 deletions tests/fixtures/myLogger2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class myLogger2 implements sfLoggerInterface
{
public $log = '';

public function log($message, $priority = null)
{
$this->log = $message;
}
}
17 changes: 17 additions & 0 deletions tests/fixtures/myLoggerWrapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class myLoggerWrapper extends sfLoggerWrapper
{
public function getLogger()
{
return $this->logger;
}
}
20 changes: 20 additions & 0 deletions tests/fixtures/myResponse2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class myResponse2 extends sfResponse
{
public function serialize() {}

public function unserialize($serialized) {}

public function __serialize() {}

public function __unserialize($data) {}
}
20 changes: 20 additions & 0 deletions tests/fixtures/myView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

class myView extends sfView
{
public function execute() {}

public function configure() {}

public function getEngine() {}

public function render() {}
}
Loading

0 comments on commit 2a0c3f7

Please sign in to comment.