Exemple #1
0
	/**
	 * @param int
	 */
	public function __construct($id = NULL)
	{
		$ref = new \Nette\Reflection\Property('Nella\Doctrine\Entity', 'id');
		$ref->setAccessible(TRUE);
		$ref->setValue($this, $id);
		$ref->setAccessible(FALSE);
	}
Exemple #2
0
	/**
	 * @param string
	 * @return \Nette\Application\UI\Presetner
	 */
	public function setName($name)
	{
		$ref = new \Nette\Reflection\Property('Nette\ComponentModel\Component', 'name');
		$ref->setAccessible(TRUE);
		$ref->setValue($this, $name);
		$ref->setAccessible(FALSE);
		return $this;
	}
Exemple #3
0
	private function injectTestDictionaryData()
	{
		$this->translator->lang = "cs";
		$this->translator->freeze();

		$mock = new \Nella\Localization\Dictionary(__DIR__, new Storages\Mock(array(
			'simple translated text' => array("jednoduchy prelozeny text"),
			'translated text' => array("prelozeny text", "prelozene texty", "prelozenych textu"),
		)));
		$mock->setPluralForm('nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4 ? 1 : 2);');
		$mock->init('test');

		$ref = new \Nette\Reflection\Property('Nella\Localization\Translator', 'dictionaries');
		$ref->setAccessible(TRUE);
		$ref->setValue($this->translator, array($mock));
		$ref->setAccessible(FALSE);
	}
	public function setSignalMock($signal)
	{
		$ref = new \Nette\Reflection\Property('Nette\Application\UI\Presenter', 'signal');
		$ref->setAccessible(TRUE);
		$ref->setValue($this, $signal);
		$ref->setAccessible(TRUE);
	}