Skip to content
Browse files

Fixed CTestCase for PHPUnit 3.7.10.

Fixed errors in generating guide PDFs.
  • Loading branch information...
1 parent d0756de commit d505aadfdbb4552ba55fbe7aaab757764470ea0a @qiangxue qiangxue committed Dec 27, 2012
View
2 build/build.xml
@@ -155,6 +155,7 @@
<echo>Building API...</echo>
<exec command="${build} api ${build.doc.dir}" dir="." passthru="true" />
+ <!--
<echo>Building API CHM...</echo>
<exec command="${hhc} ${build.doc.dir}/api/manual.hhp" />
<move file="${build.doc.dir}/api/manual.chm" tofile="${build.doc.dir}/yii-api-${yii.version}.chm" />
@@ -163,6 +164,7 @@
<include name="manual.*" />
</fileset>
</delete>
+ -->
<echo>Generating doc release file...</echo>
<mkdir dir="${build.dist.dir}" />
View
4 build/commands/GuideLatexCommand.php
@@ -33,14 +33,14 @@ function run($args)
$toc = '';
foreach($chapters as $chapter=>$sections)
{
- $toc .= sprintf("\chapter{%s}\n", $chapter);
+ $toc .= sprintf("\\chapter{%s}\n", $chapter);
foreach($sections as $path=>$section)
{
echo "creating '$section'...";
$content=file_get_contents($sourcePath."/{$path}.txt");
$this->createLatexFile($chapter,$section,$content, $path);
echo "done\n";
- $toc .= sprintf("\input{%s}\n", $path);
+ $toc .= sprintf("\\input{%s}\n", $path);
}
}
$main_file = sprintf('%s/main.tex', $this->getOutputDir());
View
26 build/commands/markdown/MarkdownHtml2Tex.php
@@ -40,11 +40,15 @@ function finalize()
}
$iswhitespace = ctype_space($content);
if (!$iswhitespace)
+ {
+ if ($class === 'special')
+ $class = 'code';
$tex_output .= sprintf('\textcolor{%s}{%s}', $class, $this->escape($content));
+ }
else
$tex_output .= $content;
}
- $this->_output = "\begin{alltt}\n" . $tex_output . "\end{alltt}";
+ $this->_output = "\\begin{alltt}\n" . $tex_output . "\\end{alltt}";
}
function escape($str)
@@ -113,13 +117,13 @@ function hypenat($text)
function escape_verbatim($matches)
{
$text = html_entity_decode($matches[1]);
- return "\n\begin{footnotesize}\begin{verbatim}".$text."\end{verbatim}\end{footnotesize}\n";
+ return "\n\\begin{footnotesize}\\begin{verbatim}".$text."\\end{verbatim}\\end{footnotesize}\n";
}
function escape_syntax($matches)
{
$text = html_entity_decode($matches[1]);
- return "\n\begin{footnotesize}".$text."\end{footnotesize}\n";
+ return "\n\\begin{footnotesize}".$text."\\end{footnotesize}\n";
}
function escape_verb($matches)
@@ -158,12 +162,12 @@ function include_figure($info, $filename, $matches)
$width = sprintf('%0.2f', $info[0]/(135/2.54));
$caption = $this->escape($matches[2]);
return <<<TEX
-\begin{figure}[htbp]
- \centering
- \includegraphics[width={$width}cm]{{$filename}}
- \label{fig:{$filename}}
- \caption{{$caption}}
-\end{figure}
+\\begin{figure}[htbp]
+ \\centering
+ \\includegraphics[width={$width}cm]{{$filename}}
+ \\label{fig:{$filename}}
+ \\caption{{$caption}}
+\\end{figure}
TEX;
}
@@ -197,7 +201,7 @@ function make_sections($matches)
$label = sprintf('\label{%s}', $this->path.'-'.$matches[2]);
if(!$this->has_path_label)
{
- $label .= sprintf("\n\label{%s}", $this->path);
+ $label .= sprintf("\n\\label{%s}", $this->path);
$this->has_path_label = true;
}
$section = sprintf('\%ssection{%s}', str_repeat('sub',intval($matches[1])-1), $matches[3]);
@@ -254,6 +258,6 @@ function parse_html($html, $path)
function mbox($matches)
{
- return "\n\begin{tipbox}\n".$matches[2]."\n\end{tipbox}\n";
+ return "\n\\begin{tipbox}\n".$matches[2]."\n\\end{tipbox}\n";
}
}
View
2 docs/blog/prototype.scaffold.txt
@@ -54,7 +54,7 @@ On the `Model Generator` page, enter `tbl_user` (the user table name) in the `Ta
Repeat the same procedure for the rest of the database tables, including `tbl_post`, `tbl_comment`, `tbl_tag` and `tbl_lookup`.
-> Tip: We can also enter an asterisk character '\*' in the `Table Name` field. This will generate a model class for *every* database table in a single shot.
+> Tip: We can also enter an asterisk character '*' in the `Table Name` field. This will generate a model class for *every* database table in a single shot.
At this stage, we will have the following newly created files:
View
2 docs/guide/database.arr.txt
@@ -16,7 +16,7 @@ section.
![ER Diagram](er.png)
> Info: Support for foreign key constraints varies in different DBMS.
-> SQLite < 3.6.19 does not support foreign key constraints, but you can still
+> SQLite 3.6.19 or prior does not support foreign key constraints, but you can still
> declare the constraints when creating tables. MySQL’s MyISAM engine
> does not support foreign keys at all.
View
2 docs/guide/index.txt
@@ -5,7 +5,7 @@ This tutorial is released under [the Terms of Yii Documentation](http://www.yiif
All Rights Reserved.
-2008-2010 &copy; Yii Software LLC.
+2008-2010 (c) Yii Software LLC.
<div class="revision">$Id$</div>
View
4 docs/guide/topics.theming.txt
@@ -244,8 +244,8 @@ We then create the needed skins. Skins belonging to the same widget class are st
<?php
return array(
'default'=>array(
- 'nextPageLabel'=>'&gt;&gt;',
- 'prevPageLabel'=>'&lt;&lt;',
+ 'nextPageLabel'=>'next',
+ 'prevPageLabel'=>'prev',
),
'classic'=>array(
'header'=>'',
View
4 framework/test/CTestCase.php
@@ -10,7 +10,11 @@
require_once('PHPUnit/Runner/Version.php');
require_once('PHPUnit/Util/Filesystem.php'); // workaround for PHPUnit <= 3.6.11
+
+spl_autoload_unregister(array('YiiBase','autoload'));
require_once('PHPUnit/Autoload.php');
+spl_autoload_register(array('YiiBase','autoload')); // put yii's autoloader at the end
+
if (in_array('phpunit_autoload', spl_autoload_functions())) { // PHPUnit >= 3.7 'phpunit_alutoload' was obsoleted
spl_autoload_unregister('phpunit_autoload');
Yii::registerAutoloader('phpunit_autoload');

0 comments on commit d505aad

Please sign in to comment.
Something went wrong with that request. Please try again.