Skip to content

Commit

Permalink
MDL-41707 add current unit test files to new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 24, 2013
1 parent 6b51aa9 commit daedd8f
Show file tree
Hide file tree
Showing 11 changed files with 400 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*~
*.swp
/tags
/TAGS
/cscope.*
/.patches/
/.idea/
/nbproject/
.DS_Store
/.settings/
/.project
/.buildpath
/.cache
40 changes: 40 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
===== Moodle Download Tests =====

This folder contains 4 files that are used for unit testing
Moodle download capabilities.

**** !!!! !!!! !!!! *****
**** It's really important to keep this *****
**** files completely unmodified in order *****
**** to obtain coherent test results. *****
**** !!!! !!!! !!!! *****

File specs:

* test.html: One test valid xhtml file containing UTF-8 chars
and differend linefeeds mixed (unix, dos, mac).
md5: 47250a973d1b88d9445f94db4ef2c97a
size: 3137

* test.jpg: One test binary (image) file.
md5: 2af180e813dc3f446a9bb7b6af87ce24
size: 39476

* downloadtests.zip: One zipped folder containing the previous
two files (test.html and test.jpg) to be used to test
the componentlib install functions.
md5: 9e94f74b3efb1ff6cf075dc6b2abf15c
size: 39481

* downloadtests.md5 : One text file, required by componentlib
in order to download the previous zip file.
md5: fde140a6d13cb0c671b1b9d190bf41ee
size: 47

* rsstest.xml: One valid rss feed.
md5: 8fd047914863bf9b3a4b1514ec51c32c
size: 32188

That's all, happy Unit Testing!
20071222 stronk7: initial version
20071230 stronk7: added rss test file
40 changes: 40 additions & 0 deletions behat-rsstest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Behat Test Feed</title>
<link>http://moodle.org/mod/forum/view.php?f=1</link>
<description>
This is a test feed.

Moodle is a leading open-source course management system (CMS) - a software package designed to help educators create quality online courses. Such e-learning systems are sometimes also called Learning Management Systems (LMS) or Virtual Learning Environments (VLE). One of the main advantages of Moodle over other systems is a strong grounding in social constructionist pedagogy.</description>
<generator>Moodle</generator>
<copyright>&amp;#169; 2013 moodle</copyright>
<image>
<url>http://moodle.org/pix/i/rsssitelogo.gif</url>
<title>moodle</title>
<link>http://moodle.org</link>
<width>140</width>
<height>35</height>
</image>
<item>
<title>Feed item 1 title</title>
<link>http://moodle.org/mod/forum/discuss.php?d=85629</link>
<pubDate>Fri, 30 Nov 2007 16:47:33 WST</pubDate>
<description>Item 1 description.
&lt;br /&gt;
More info.
</description>
<guid isPermaLink="true">http://moodle.org/mod/forum/discuss.php?d=85629</guid>
</item>
<item>
<title>Feed item 2 title</title>
<link>http://moodle.org/mod/forum/discuss.php?d=84296</link>
<pubDate>Mon, 12 Nov 2007 16:58:29 WST</pubDate>
<description>Item 2 description.
&lt;br /&gt;
More info.
</description>
<guid isPermaLink="true">http://moodle.org/mod/forum/discuss.php?d=84296</guid>
</item>
</channel>
</rss>
1 change: 1 addition & 0 deletions downloadtests.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
downloadtests,9e94f74b3efb1ff6cf075dc6b2abf15c
Binary file added downloadtests.zip
Binary file not shown.
Empty file added index.html
Empty file.
248 changes: 248 additions & 0 deletions rsstest.xml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="KEYWORDS" content="Test Page" />
<title>Test Page</title>
</head>
<body>
<p>Moodle is a software package for producing internet-based courses and web sites. It's an ongoing development project designed to support a social constructionist framework of education.</p>
<p>Moodle es un paquete de software para la creación de cursos y sitios Web basados en Internet. Es un proyecto en desarrollo diseñado para dar soporte a un marco de educación social constructivista.</p>
<p>Moodle [čti můdl] je softwarový balíček pro tvorbu výukových systémů a elektronických kurzů na internetu. Jedná se o neustále se vyvíjející projekt, navržený na základě sociálně konstruktivistického přístupu k vzdělávání.</p>
<p>Moodleはインターネット上で授業用のWebページを作るためのソフトです。教育学でいう社会的構築主義の考え方に基づいて作られており,日々改良が行われています。</p>
<hr />
<p>Moodle is a software package for producing internet-based courses and web sites. It's an ongoing development project designed to support a social constructionist framework of education.</p>
<p>Moodle es un paquete de software para la creación de cursos y sitios Web basados en Internet. Es un proyecto en desarrollo diseñado para dar soporte a un marco de educación social constructivista.</p>
<p>Moodle [čti můdl] je softwarový balíček pro tvorbu výukových systémů a elektronických kurzů na internetu. Jedná se o neustále se vyvíjející projekt, navržený na základě sociálně konstruktivistického přístupu k vzdělávání.</p>
<p>Moodleはインターネット上で授業用のWebページを作るためのソフトです。教育学でいう社会的構築主義の考え方に基づいて作られており,日々改良が行われています。</p>
<hr />
<p>Moodle is a software package for producing internet-based courses and web sites. It's an ongoing development project designed to support a social constructionist framework of education.</p> <p>Moodle es un paquete de software para la creación de cursos y sitios Web basados en Internet. Es un proyecto en desarrollo diseñado para dar soporte a un marco de educación social constructivista.</p> <p>Moodle [čti můdl] je softwarový balíček pro tvorbu výukových systémů a elektronických kurzů na internetu. Jedná se o neustále se vyvíjející projekt, navržený na základě sociálně konstruktivistického přístupu k vzdělávání.</p> <p>Moodleはインターネット上で授業用のWebページを作るためのソフトです。教育学でいう社会的構築主義の考え方に基づいて作られており,日々改良が行われています。</p> </body>
</html>
Expand Down
Binary file added test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions test_redir.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

if (isset($_GET['done']) and $_GET['done'] == 1) {
echo 'done';
die;
}

$testurl = 'http://download.moodle.org/unittest/test_redir.php';

$redir = isset($_GET['redir']) ? $_GET['redir'] : 5;
if ($redir > 10) {
$redir = 10;
}

if ($redir <= 1) {
$target = "$testurl?done=1";
} else {
$redir--;
$target = "$testurl?redir=$redir";
}

header('HTTP/1.1 302 Found');
header("Location: $target");
15 changes: 15 additions & 0 deletions test_relative_redir.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

$type = isset($_POST['type']) ? $_POST['type'] : (isset($_GET['type']) ? $_GET['type'] : (302));

$type = (int)$type;

switch ($type) {
case 301: header('HTTP/1.1 301 Moved Permanently'); break;
case 303: header('HTTP/1.1 303 See Other'); break;
case 307: header('HTTP/1.1 307 Temporary Redirect'); break;
case 308: header('HTTP/1.1 308 Permanent Redirect'); break;
default: header('HTTP/1.1 302 Found'); break;
}

header("Location: test_redir.php?done=1");

0 comments on commit daedd8f

Please sign in to comment.