Browse Source

test case

euromark 13 years ago
parent
commit
dd6787eae7

File diff suppressed because it is too large
+ 1416 - 0
Test/Case/Model/Behavior/RevisionBehaviorTest.php


+ 47 - 0
Test/Fixture/RevisionArticleFixture.php

@@ -0,0 +1,47 @@
+<?php
+class RevisionArticleFixture extends CakeTestFixture {
+	var $name = 'RevisionArticle';
+	var $fields = array(
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL, 
+					'key' => 'primary'), 
+			'user_id' => array('type' => 'integer', 'null' => false, 'default' => NULL), 
+			'parent_id' => array('type' => 'integer','null' => true,'default' => NULL),
+			'lft' => array('type' => 'integer','null' => true,'default' => NULL),
+			'rght' => array('type' => 'integer','null' => true,'default' => NULL),
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL), 
+			'indexes' => array('PRIMARY' => array('column' => 'id')));
+	var $records = array(
+		array(
+			'id' => 1, 
+			'user_id' => 1, 
+			'parent_id' => null,
+			'lft' => 1,
+			'rght' => 6,
+			'title' => 'Lorem ipsum dolor sit amet', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.'
+		),
+		array(
+			'id' => 2, 
+			'user_id' => 1, 
+			'parent_id' => 1,
+			'lft' => 2,
+			'rght' => 3,
+			'title' => 'Lorem ipsum', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.'
+		),
+		array(
+			'id' => 3, 
+			'user_id' => 1, 
+			'parent_id' => 1,
+			'lft' => 4,
+			'rght' => 5,
+			'title' => 'Lorem ipsum', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.'
+		),
+	);
+}
+?>

+ 16 - 0
Test/Fixture/RevisionArticlesRevFixture.php

@@ -0,0 +1,16 @@
+<?php
+class RevisionArticlesRevFixture extends CakeTestFixture {
+	var $name = 'RevisionArticlesRev';
+	var $fields = array(
+			'version_id' => array('type' => 'integer','null' => false,'default' => NULL,'key' => 'primary'), 
+			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+			'id' => array('type' => 'integer','null' => false,'default' => NULL), 
+			'user_id' => array('type' => 'integer', 'null' => false, 'default' => NULL), 
+			'parent_id' => array('type' => 'integer','null' => true,'default' => NULL), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL),
+			'indexes' => array('PRIMARY' => array('column' => 'version_id')));
+	var $records = array(
+	);
+}
+?>

+ 32 - 0
Test/Fixture/RevisionCommentFixture.php

@@ -0,0 +1,32 @@
+<?php
+
+class RevisionCommentFixture extends CakeTestFixture {
+	var $name = 'RevisionComment';
+	var $fields = array(
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL, 
+					'key' => 'primary'), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL), 
+			'indexes' => array('PRIMARY' => array('column' => 'id')));
+	var $records = array(
+		array(
+			'id' => 1, 
+			'title' => 'Comment 1', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.', 
+		),
+		array(
+			'id' => 2, 
+			'title' => 'Comment 2', 
+			'content' => 'Lorem ipsum dolor sit.', 
+		),
+		array(
+			'id' => 3, 
+			'title' => 'Comment 3', 
+			'content' => 'Lorem ipsum dolor sit.', 
+		),
+	);
+}
+?>

+ 42 - 0
Test/Fixture/RevisionCommentsRevFixture.php

@@ -0,0 +1,42 @@
+<?php
+class RevisionCommentsRevFixture extends CakeTestFixture {
+	var $name = 'RevisionCommentsRev';
+	var $fields = array(	
+			'version_id' => array('type' => 'integer','null' => false,'default' => NULL,'key' => 'primary'), 
+			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL),
+			'Tag' => array('type' => 'string', 'null' => true, 'default' => NULL)
+	);
+	var $records = array(	
+		array(
+			'version_id' => 1,
+			'version_created' => '2008-12-08 11:38:53',
+			'id' => 1, 
+			'title' => 'Comment 1', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.', 
+			'Tag' => '1,2,3'
+		),	
+		array(
+			'version_id' => 2,
+			'version_created' => '2008-12-08 11:38:54',
+			'id' => 2, 
+			'title' => 'Comment 2', 
+			'content' => 'Lorem ipsum dolor sit.', 
+			'Tag' => '1,3'
+		),
+		array(
+			'version_id' => 3,
+			'version_created' => '2008-12-08 11:38:55',
+			'id' => 3, 
+			'title' => 'Comment 3', 
+			'content' => 'Lorem ipsum dolor sit.', 
+			'Tag' => null
+		),
+	);
+}
+?>

+ 42 - 0
Test/Fixture/RevisionCommentsRevisionTagFixture.php

@@ -0,0 +1,42 @@
+<?php
+class RevisionCommentsRevisionTagFixture extends CakeTestFixture {
+	var $name = 'RevisionCommentsRevisionTag';
+	var $fields = array(
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL, 
+					'key' => 'primary'), 
+			'revision_comment_id' => array('type' => 'integer', 'null' => false),  
+			'revision_tag_id' => array('type' => 'integer', 'null' => false),  
+			'indexes' => array('PRIMARY' => array('column' => 'id')));
+	
+	var $records = array(
+		array(
+			'id' => 1, 
+			'revision_comment_id' => 1, 
+			'revision_tag_id' => 1
+		),
+		array(
+			'id' => 2, 
+			'revision_comment_id' => 1, 
+			'revision_tag_id' => 2
+		),
+		array(
+			'id' => 3, 
+			'revision_comment_id' => 1, 
+			'revision_tag_id' => 3
+		),
+		array(
+			'id' => 4, 
+			'revision_comment_id' => 2, 
+			'revision_tag_id' => 1
+		),
+		array(
+			'id' => 5, 
+			'revision_comment_id' => 2, 
+			'revision_tag_id' => 3
+		),
+	);
+}
+?>

+ 50 - 0
Test/Fixture/RevisionCommentsRevisionTagsRevFixture.php

@@ -0,0 +1,50 @@
+<?php
+class RevisionCommentsRevisionTagsRevFixture extends CakeTestFixture {
+	var $name = 'RevisionCommentsRevisionTagsRev';
+	var $fields = array(
+			'version_id' => array('type' => 'integer','null' => false,'default' => NULL,'key' => 'primary'), 
+			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+			'id' => array('type' => 'integer','null' => false), 
+			'revision_comment_id' => array('type' => 'integer', 'null' => false),  
+			'revision_tag_id' => array('type' => 'integer', 'null' => false),  
+			'indexes' => array('PRIMARY' => array('column' => 'version_id')));
+	
+	var $records = array(
+		array(
+			'version_id' => 1,
+			'version_created' => '2008-12-08 11:38:53',
+			'id' => 1, 
+			'revision_comment_id' => 1, 
+			'revision_tag_id' => 1
+		),
+		array(
+			'version_id' => 2,
+			'version_created' => '2008-12-08 11:38:55',
+			'id' => 2, 
+			'revision_comment_id' => 1, 
+			'revision_tag_id' => 2
+		),
+		array(
+			'version_id' => 3,
+			'version_created' => '2008-12-08 11:38:56',
+			'id' => 3, 
+			'revision_comment_id' => 1, 
+			'revision_tag_id' => 3
+		),
+		array(
+			'version_id' => 4,
+			'version_created' => '2008-12-08 11:38:57',
+			'id' => 4, 
+			'revision_comment_id' => 2, 
+			'revision_tag_id' => 1
+		),
+		array(
+			'version_id' => 5,
+			'version_created' => '2008-12-08 11:38:58',
+			'id' => 5, 
+			'revision_comment_id' => 2, 
+			'revision_tag_id' => 3
+		),
+	);
+}
+?>

+ 31 - 0
Test/Fixture/RevisionPostFixture.php

@@ -0,0 +1,31 @@
+<?php
+class RevisionPostFixture extends CakeTestFixture {
+	var $name = 'RevisionPost';
+	var $fields = array(
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL, 
+					'key' => 'primary'), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL), 
+			'indexes' => array('PRIMARY' => array('column' => 'id')));
+	var $records = array(
+		array(
+			'id' => 1, 
+			'title' => 'Lorem ipsum dolor sit amet', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.'
+		),
+		array(
+			'id' => 2, 
+			'title' => 'Post 2', 
+			'content' => 'Lorem ipsum dolor sit.'
+		),
+		array(
+			'id' => 3, 
+			'title' => 'Post 3', 
+			'content' => 'Lorem ipsum dolor sit.', 
+		),
+	);
+}
+?>

+ 34 - 0
Test/Fixture/RevisionPostsRevFixture.php

@@ -0,0 +1,34 @@
+<?php
+class RevisionPostsRevFixture extends CakeTestFixture {
+	var $name = 'RevisionPostsRev';
+	var $fields = array(
+			'version_id' => array('type' => 'integer','null' => false,'default' => NULL,'key' => 'primary'), 
+			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+			'id' => array('type' => 'integer','null' => false,'default' => NULL), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL));
+	var $records = array(
+		array(			
+			'version_id' => 1,
+			'version_created' => '2008-12-08 11:38:53',
+			'id' => 1, 
+			'title' => 'Lorem ipsum dolor sit amet', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.'
+		),	
+		array(
+			'version_id' => 2,
+			'version_created' => '2008-12-08 11:38:54',
+			'id' => 2, 
+			'title' => 'Post 2', 
+			'content' => 'Lorem ipsum dolor sit.'
+		),
+		array(
+			'version_id' => 3,
+			'version_created' => '2008-12-08 11:38:55',
+			'id' => 3, 
+			'title' => 'Post 3', 
+			'content' => 'Lorem ipsum dolor sit.', 
+		),
+	);
+}
+?>

+ 32 - 0
Test/Fixture/RevisionTagFixture.php

@@ -0,0 +1,32 @@
+<?php
+class RevisionTagFixture extends CakeTestFixture {
+	var $name = 'RevisionTag';
+	var $fields = array(
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL, 
+					'key' => 'primary'), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL),
+			'indexes' => array('PRIMARY' => array('column' => 'id')));
+	
+	var $records = array(
+		array(
+			'id' => 1, 
+			'title' => 'Fun', 
+		),
+		array(
+			'id' => 2, 
+			'title' => 'Hard'
+		),
+		array(
+			'id' => 3, 
+			'title' => 'Trick'
+		),
+		array(
+			'id' => 4, 
+			'title' => 'News'
+		),
+	);
+}
+?>

+ 46 - 0
Test/Fixture/RevisionTagsRevFixture.php

@@ -0,0 +1,46 @@
+<?php
+
+class RevisionTagsRevFixture extends CakeTestFixture {
+	var $name = 'RevisionTagsRev';
+	var $fields = array(	
+			'version_id' => array('type' => 'integer','null' => false,'default' => NULL,'key' => 'primary'), 
+			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+			'id' => array('type' => 'integer', 'null' => false,'default' => NULL), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL)
+	);
+	
+	var $records = array(
+		array(
+			'version_id' => 1, 
+			'version_created' => '2008-12-24 11:00:01',
+			'id' => 1,
+			'title' => 'Fun'
+		),
+		array(
+			'version_id' => 2, 
+			'version_created' => '2008-12-24 11:00:02',
+			'id' => 2,
+			'title' => 'Hard'
+		),
+		array(
+			'version_id' => 3, 
+			'version_created' => '2008-12-24 11:00:03',
+			'id' => 3,
+			'title' => 'Tricks'
+		),
+		array(
+			'version_id' => 4, 
+			'version_created' => '2008-12-24 11:00:04',
+			'id' => 3,
+			'title' => 'Trick'
+		),
+		array(
+			'version_id' => 5, 
+			'version_created' => '2008-12-24 11:00:22',
+			'id' => 4,
+			'title' => 'News'
+		),
+	);
+}
+
+?>

+ 18 - 0
Test/Fixture/RevisionUserFixture.php

@@ -0,0 +1,18 @@
+<?php 
+class RevisionUserFixture extends CakeTestFixture {
+	var $name = 'RevisionUser';
+	var $fields = array(
+			'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
+			'name' => array('type'=>'string', 'null' => false, 'default' => NULL),
+			'username' => array('type'=>'string', 'null' => false, 'default' => NULL),
+			'created' => array('type'=>'date', 'null' => false, 'default' => NULL),
+			'indexes' => array('PRIMARY' => array('column' => 'id'))
+			);
+	var $records = array(array(
+			'id'  => 1,
+			'name'  => 'Alexander',
+			'username'  => 'alke',
+			'created'  => '2008-12-07'
+			));
+}
+?>

+ 37 - 0
Test/Fixture/RevisionVoteFixture.php

@@ -0,0 +1,37 @@
+<?php
+
+class RevisionVoteFixture extends CakeTestFixture {
+	var $name = 'RevisionVote';
+	var $fields = array(
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL, 
+					'key' => 'primary'), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL), 
+			'revision_comment_id' => array('type'=>'integer','null'=>false),
+			'indexes' => array('PRIMARY' => array('column' => 'id')));
+	
+	var $records = array(
+		array(
+			'id' => 1, 
+			'title' => 'Lorem ipsum dolor sit amet', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.', 
+			'revision_comment_id' => 1
+		),
+		array(
+			'id' => 2, 
+			'title' => 'Stuff', 
+			'content' => 'Lorem ipsum dolor sit.',
+			'revision_comment_id' => 1
+		),
+		array(
+			'id' => 3, 
+			'title' => 'Stuff', 
+			'content' => 'Lorem ipsum dolor sit.',
+			'revision_comment_id' => 2
+		),
+	);
+}
+?>

+ 42 - 0
Test/Fixture/RevisionVotesRevFixture.php

@@ -0,0 +1,42 @@
+<?php
+class RevisionVotesRevFixture extends CakeTestFixture {
+	var $name = 'RevisionVotesRev';
+	var $fields = array(	
+			'version_id' => array('type' => 'integer','null' => false,'default' => NULL,'key' => 'primary'), 
+			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
+			'id' => array(
+					'type' => 'integer', 
+					'null' => false, 
+					'default' => NULL), 
+			'title' => array('type' => 'string', 'null' => false, 'default' => NULL), 
+			'content' => array('type' => 'text', 'null' => false, 'default' => NULL), 
+			'revision_comment_id' => array('type'=>'integer','null'=>false));
+	
+	var $records = array(
+		array(
+			'version_id' => 1,
+			'version_created' => '2008-12-08 11:38:53',
+			'id' => 1, 
+			'title' => 'Lorem ipsum dolor sit amet', 
+			'content' => 'Lorem ipsum dolor sit amet, aliquet feugiat.', 
+			'revision_comment_id' => 1
+		),
+		array(
+			'version_id' => 2,
+			'version_created' => '2008-12-08 11:38:53',
+			'id' => 2, 
+			'title' => 'Stuff', 
+			'content' => 'Lorem ipsum dolor sit.',
+			'revision_comment_id' => 1
+		),
+		array(
+			'version_id' => 3,
+			'version_created' => '2008-12-08 11:38:53',
+			'id' => 3, 
+			'title' => 'Stuff', 
+			'content' => 'Lorem ipsum dolor sit.',
+			'revision_comment_id' => 2
+		),
+	);
+}
+?>