Learn
- Clean Code, YouTube
- PHP: The Right Way, link
- Udemy courses
- Design Pattern, Doc
- Postman for testing API, YouTube
Todo - Project repo, doc
- Local Taverna
- Study Taverna Rest Service
- Could use beanshell to retrieve webapp
Done - Project
- Update prototype
Todo
- Add-additional-info-to-preview-#428
- Pass unit test for
FormattedDatasetLinkPreview
- Try to pass the acceptance test
Done
- Add-delete-button-#457
- Update the scenario
- Update the acceptance implementation to assert the actual
attribute id
/**
* @Then I should see field :arg1 with value :arg2
*/
public function iShouldSeeFieldWithValue($arg1, $arg2)
{
$row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s")', $arg1));
preg_match('/<td>[\d*\s]*<\/td>/', $row->getHtml(), $matches);
$search = array("<td>", "</td>");
$actual_attribute_id = str_replace($search,"", $matches[0]);
PHPUnit_Framework_Assert::assertEquals($arg2, $actual_attribute_id);
}
/**
* @Then I should see field :arg1 without value :arg2
*/
public function iShouldSeeFieldWithoutValue($arg1, $arg2)
{
$row = $this->minkContext->getSession()->getPage()->find('css', sprintf('table tr:contains("%s")', $arg1));
preg_match('/<td>[\d*\s]*<\/td>/', $row->getHtml(), $matches);
$search = array("<td>", "</td>");
$actual_attribute_id = str_replace($search,"", $matches[0]);
PHPUnit_Framework_Assert::assertNotEquals($arg2, $actual_attribute_id);
}
- Fix
Undefined variable: attribute_id
error by getting the attribute_id
from FileAttribute
table directly.
<?php
$sample_id = FileSample::model()->find('file_id=:file_id', array(':file_id'=>$model->id));
$attributes = FileAttributes::model()->findAll('file_id=:file_id', array(':file_id'=>$model->id));
if(isset($sample_id))
{
$sample_name= Sample::model()->find('id=:id',array(':id'=>$sample_id->sample_id));
}
$name="Not Set";
if(isset($sample_id)&&isset($sample_name))
{
$name=$sample_name->name;
}
$attribute_id = "";
if(!empty($attributes))
{
foreach ($attributes as $attribute)
{
$attribute_id .= $attribute->id . " ";
}
}else{
$attribute_id = "Not Set";
}
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'dataset_id',
'name',
'location',
'extension',
'size',
'description',
'date_stamp',
'format_id',
'type_id',
array(
'name'=>'Sample',
'value'=> $name,
),
array(
'name'=>'FileAttributeID',
'value'=>$attribute_id,
)
),
)); ?>
- Retrieve citation detail in text in dataset page
- Fix the
dropdown box
position
- Update the
patterned library
Reference