Excel-Writer-XLSX
view release on metacpan or search on metacpan
t/chartsheet/sub_write_sheet_protection.t view on Meta::CPAN
$chartsheet->_write_sheet_protection();
is( $got, $expected, $caption );
###############################################################################
#
# 5. Test the _write_sheet_protection() method.
#
$caption = " \tChartsheet: _write_sheet_protection()";
$expected = '';
$password = '';
%options = ( content => 0, objects => 0 );
$chartsheet = _new_object( \$got, 'Excel::Writer::XLSX::Chartsheet' );
$chartsheet->protect( $password, \%options );
$chartsheet->_write_sheet_protection();
is( $got, $expected, $caption );
###############################################################################
#
# 6. Test the _write_sheet_protection() method.
#
$caption = " \tChartsheet: _write_sheet_protection()";
$expected = '<sheetProtection password="83AF"/>';
$password = 'password';
%options = ( content => 0, objects => 0 );
$chartsheet = _new_object( \$got, 'Excel::Writer::XLSX::Chartsheet' );
$chartsheet->protect( $password, \%options );
$chartsheet->_write_sheet_protection();
is( $got, $expected, $caption );
###############################################################################
#
# 7. Test the _write_sheet_protection() method.
#
$caption = " \tChartsheet: _write_sheet_protection()";
$expected = '<sheetProtection password="83AF" content="1" objects="1"/>';
$password = 'password';
%options = (
objects => 1,
scenarios => 1,
format_cells => 1,
format_columns => 1,
format_rows => 1,
insert_columns => 1,
insert_rows => 1,
insert_hyperlinks => 1,
delete_columns => 1,
delete_rows => 1,
select_locked_cells => 0,
sort => 1,
autofilter => 1,
pivot_tables => 1,
select_unlocked_cells => 0,
);
$chartsheet = _new_object( \$got, 'Excel::Writer::XLSX::Chartsheet' );
$chartsheet->protect( $password, \%options );
$chartsheet->_write_sheet_protection();
is( $got, $expected, $caption );
__END__
( run in 0.979 second using v1.01-cache-2.11-cpan-39bf76dae61 )