Example #1
0
	function test_article() {
		$article = new Article(9000001,9000002,9000003,9000004);

		// Test create
		$article->create("Unit Test Long Name",
						 "Unit Test Short Name",
						 "fastnews");
		$this->assertTrue($article->exists());

		// Test SET functions
		$article->setTitle("Unit Test New Title");
		$article->setCreatorId(9000005);
		$article->setOnFrontPage(true);
		$article->setOnSection(true);
		$article->setWorkflowStatus('Y');
		$article->setKeywords("Unit, Test");
		$article->setIsIndexed(true);

		// Test GET functions
		$articleCopy = new Article(9000001, 9000002, 9000003, 9000004, $article->getArticleId());
		$this->assertEquals(9000001, $articleCopy->getPublicationId());
		$this->assertEquals(9000002, $articleCopy->getIssueNumber());
		$this->assertEquals(9000003, $articleCopy->getSectionNumber());
		$this->assertEquals(9000004, $articleCopy->getLanguageId());
		$this->assertEquals(9000005, $articleCopy->getCreatorId());
		$this->assertEquals("Unit Test New Title", $articleCopy->getTitle());
		$this->assertEquals(true, $articleCopy->onFrontPage());
		$this->assertEquals(true, $articleCopy->onSection());
		$this->assertEquals('Y', $articleCopy->getWorkflowStatus());
		$this->assertEquals("Unit, Test", $articleCopy->getKeywords());
		$this->assertEquals(true, $articleCopy->isIndexed());

		// Test DELETE functions
		$article->delete();
		$this->assertFalse($article->exists());
	}
Example #2
0
        				<?php putGS('Allow users without subscriptions to view the article'); ?>
        				</TD>
        			</TR>
        			</TABLE>
        		</TD>
        	</TR>

        	<TR>
        		<TD style="border-top: 1px solid #8baed1; padding-top: 3px;">
        			<TABLE>
        			<TR>
        				<td align="left" style="padding-right: 5px;">
        				</td>
        				<TD ALIGN="RIGHT" ><?php  putGS("Keywords"); ?>:</TD>
        				<TD>
        					<?php print htmlspecialchars($curPreview->getKeywords()); ?>
        				</TD>
        			</TR>

        			<?php
        			// Display the article type fields.
        			$i = 0;
        			if ($f_prev_action == 'Orig') $dbColumns = $srcDbColumns;
        			foreach ($dbColumns as $dbColumn) {
                        if ($f_prev_action == 'Orig') {
                            $text = $srcArticleData->getProperty($dbColumn->getName());
                        } elseif ($f_src_c[$dbColumn->getPrintName()] != 'NULL') {
            				$text = $srcArticleData->getProperty('F'. $f_src_c[$dbColumn->getPrintName()]);
                        } else {
                            $text = '';
                        }